Underneath sits
示 'altar', originally a pictograph of a stone slab where offerings were laid. Roof + altar = the room where ancestors are worshipped. From this concrete image grew every modern sense: ancestral clan (
祖宗), school of thought (
宗派), purpose (
宗旨), religion (
宗教).
宗 is a compound ideograph, not phonetic.