Because ghosts are immaterial, they can pass through walls.
Objection, Your Honour! The defendants criminal record is immaterial to this case.
Wikipedia foundation.