The reason that the roof of a building does not collapse is, oddly enough, air pressure.
You are right to say that there is a tremendous amount of pressure pushing down on the roof of the building. However, there is an equal amount of air pressure pushing back up on the roof. The reason for this is that molecules in gas can move in every direction and exert pressure in every direction.
So there is not really any net force pushing the roof down and so it will not collapse, at least not just from the air pressure pushing down on it.
The roof of a building has atmospheric air pressing it from all sides, with the result that net force acting on it because of atmospheric pressure is nil. However, if we were to make a building or a room, within which a vacuum was maintained, then the net atmospheric pressure acting on such a building will tend to press in the building from all sides, and therefore its roof as well as walls and floors will have to be made strong enough to withstand the atmospheric pressure.
We can demonstrate this effect of atmospheric pressure using the example of an empty carton of some soft drink. Normally such a carton does not collapse under atmospheric pressure. Bur if we such air our of the carton, and thereby reduce the air pressure inside the carton, it will collapse under influence of atmospheric air pressure.