Because constitutional protection don't stop because you don't like companies. A refusal of entry does not stop the city from taking action, an inspection warrant is not difficult to obtain. Penalties are assessed each day a violation occurs, which is no small amount. A building owner who does not correct deficiencies can find themselves with a bill for the demolition of the building and no building. The city has more than enough tools to enforce the building code. It could be that the building was not in compliance, then brought into compliance and then in November which into non-compliance. Not enough information to tell if the city screwed up as well.
CA CODE OF CIVIL PROCEDURE
SECTION 1822.50-1822.60
1822.50. An inspection warrant is an order, in writing, in the name
of the people, signed by a judge of a court of record, directed to a
state or local official, commanding him to conduct any inspection
required or authorized by state or local law or regulation relating
to building, fire, safety, plumbing, electrical, health, labor, or
zoning.