In Christian cemeteries, headstones traditionally face the east as a symbol of the deceased person's anticipation of the second coming of Christ. This event, which is central to the Christian faith, is foretold in Matthew 24:27 as coming from the east and flashing to the west like "the lightning."
A similar practice can be observed in Muslim cemeteries, where burials typically face the direction of Mecca. As a result, the specific alignment of a headstone varies according to the location of the cemetery in relation to Mecca.
In Jewish cemeteries, there exists no scriptural requirement for headstones to face a particular direction. Graves in the same section tend to be identically aligned, but this is only to promote equality and make the best use of space.