To place a building into the world, the ground has to be suitable to the building. You cannot place a building on a slope, or cliff, without terraforming it into level ground.
The process of terraforming can create slopes that trap villagers or that keep villagers from entering buildings.
Why can't we put a building on a slope?
I suggest that it should be able to build a building such that the foundation creates a level platform. A foundation like this could take more resources, which is fine.