If it weren't legal, we'd instead just see deals like this go to friends/family of the owner, or the payment would be under-the-table instead of an upfront broker's fee.
Why don't we just make murder and rape also legal to better track it?
Whenever we artificially manipulate the market with ceiling prices, it necessarily means there will be some demand unfulfilled. A better approach is to build enough housing to satisfy the demand.