Companies are not free to do whatever they want. The government compels monopolists to avoid anticompetitive behavior, and even breaks companies up, for examples. The market in this case is a little hard to define, since apartment seekers aren't purchasing the product, so I'm sure it's not actually illegal, but it sure seems to violate the spirit of these laws, which are designed to protect consumers from exactly this kind of behavior.