Top roof radical — the indexing component. The roof represents the building or post being protected. 宀 puts 守 in a dwelling-and-protection family with 安 (peace under roof), 宅 (residence), 客 (guest), 家 (home). Here the roof is what gets guarded.
Bottom 寸 — originally a hand with a marker on the wrist showing a measured inch. In compounds it often signals the careful hand of authority or rule. Hand under roof = a hand keeping watch over the dwelling, the visual core of 'to guard.'