Contracts are illegal if they require a signatory to break the law, so the contract here is detailing that this specific clause does not apply if following it would contradict the law. It's basically saying that no signatory may hold the other for breaking contract terms if the reason for breaking the contract terms is because the law specifically says these things are required.
For example, if the contract reads "The hotel does not allow guests to have animals in the room", this creates an illegal situation if said animal is a guide dog assisting a blind person, which must be allowed under laws for Americans with Disabilities Act (ADA).
By changing this clause to "The hotel does not allow guests to have animals in the room, except as required by federal, state or local law." Then it is now acceptable. A able bodied guest will still be in breach of contract if a cat is brought into the room, but a blind person would not be in breach because the law says you cannot use this to bar a blind person with a guide dog, and the contract must comply with the law. The Cat Person can be thrown out for breech of contract, but the blind person cannot because this exception allows the blind person to bring the dog into the rented room.