How is the poem "The Moon" by P.B. Shelley an allegorical poem?
There are different ways to interpret any poem. And although some poems and literary texts have traditionally been explicated to illustrate one particular allegory, this is one such poem which could have multiple allegories.
One is that this is an allegory about loneliness, particularly with the dying woman, whose mind is fading and presumably, her husband and/or friends are mostly all gone.
Often with Romantic poetry, there is a connection or comparison with humans and nature. Here, the dying woman is compared to the moon. As the woman is close to death, she is nearly between this world and the heavenly world. So, she is compared with the moon which is between the Earth and the stars. She is weary from nearly reaching the stars (the afterlife - of a different birth as in born again into a new world). Yet, she is still alive and can only climb toward heaven, not yet reaching it. She can only gaze back at the Earth, finding no companion. She is, like the moon, stuck between the world of the living and the heavens. In this interpretation, this is an allegory for the loneliness of old age, of being between two natures.