The contract terms could very well have actually had a meaning that included filming inside the apartment. The existence of other laws overriding the contract isn't actually the same thing as the contract not having that invasive meaning.
Otherwise, you could just make contracts anytime you wanted to break the law for any reason.