surely this is breaking and entering? Trespassing?
I don’t know any of the specifics of this situation...but, in many communities, the code compliance people have the authority of law enforcement.
The reason given is that they need this authority to be able to write tickets for tall grass, etc. Of course, the downside is that these untrained idiots have, well, police powers...and can go whever thay want, to enforce the law.
He’s just going to say he went in there to make sure the house was indeed inhabited, nobody was dead in there, etc. Most people would call the police...but, he may be the police.