A better question is why does light pass through air and glass but not through brick and stone?
To 'stop' or block light you need it to interact and be reflected or scattered or absorbed. For any those processes to take place there must an interaction of the correct energy , ie similar, for the photon. So in brick and stone there are processes that can absorb the photons and in air/glass there aren't many absorption opportunities.
A better question is why does light pass through air and glass but not through brick and stone?
To 'stop' or block light you need it to interact and be reflected or scattered or absorbed. For any those processes to take place there must an interaction of the correct energy , ie similar, for the photon. So in brick and stone there are processes that can absorb the photons and in air/glass there aren't many absorption opportunities.