Understand it's not about a literal roof, but the idea of having a safe place to live. After the storm, the community ensured everyone still had a roof over their heads.
Pro Tip 2/3
Security Emphasis
It often highlights the security and basic need of having a stable living situation. No matter what happens, I'll make sure we always have a roof over our heads.
Pro Tip 3/3
Figurative Use
It's used to express the concept of home or shelter figuratively, not the physical structure of a roof. They don't own a house but renting a room means they have a roof over their heads.