Hamlet is not necessarily a play about "religion" but it does register many of religious ideologies and spiritual anxieties of the 16th century. Here we're talking about the effects of the Protestant Reformation, and Christian ideas about "Mortality" and the afterlife, all of which have major implications for the play's portrayal of the ghost. Hamlet is also interesting for the way it weaves together Christian attitudes toward murder, suicide, and revenge, which don't necessarily square with the basic tenets we typically find in the "Genre" of Revenge Tragedy.
Hamlet is a play that dramatizes the spiritual uncertainty and religious confusion of sixteenth century Europe.
Shakespeare's play weaves together Christian attitudes toward murder with the classic tenets of revenge tragedy, which can't always be reconciled; this makes the play all the more dramatic and complex.