Photons pass through glass because they are not absorbed. And they are not absorbed because there is nothing which "absorbs" light in visual frequencies in glass. You may have heard that ultraviolet photons are absorbed by glass, so glass is not transparent for them. Exactly the same happens with X-rays for which our body is nearly transparent whilst a metal plate absorbs it.
All photons have a certain frequency - which for visible light is related to the colour of light, whilst for lower or upper frequencies in the electromagnetic spectrum it is simply a measure of the energy transported by a photon. A material's absorption spectrum (which frequencies are absorbed and how much so) depends on the structure of the material at atomic scale. Absorption may be from atoms which absorb photons (remember - electrons go to upper energetic states by absorbing photons), from molecules, or from lattices. There are important differences in these absorption possibilities:
Atoms absorb well-defined discrete frequencies.
Molecules absorb discrete frequencies but there are many more absorption lines because even a simple molecule has many more energetic levels than any atom. So molecules absorb much more light.
Crystalline lattices may absorb not only discrete frequencies but also continuous bands of frequencies, mainly because of discrepancies in the crystalline structure.
It is all down to the molecular and atomic properties of materials in the light spectrum. The light spectrum that our eyes have evolved to detect. Beings from other worlds, if they exist, may be able to 'see' through steel or concrete..