I know it's common in my city, Sydney, for apartment complexes to build enough car spaces for the occupants. Part of the issue is that of they didn't have that requirement, none would be built, I steady putting extra pressure on street parking and public parking facilities. Residents of those complexes also have no entitlement to a parking permit, which older houses without spots do have.
Nowadays, in inner city with less car need, the spaces required is reduced, with some spots reserved for car share schemes instead.
So, like everything, blanket rules aren't great but rules are needed for a reason.