Why does Romeo mock the moon in "Romeo and Juliet"?
You are referring to the balcony scene of this play, which takes place in Act II, scene ii. First, lets clear up one point - Romeo isn't the only one to mock the moon. Juliet does as well. We'll look at his quote, then at hers.
Arise, fair sun, and kill the envious moon,
Who is already sick and pale with grief(5)
That thou her maid art far more fair than she.
Romeo says the the moon is "envious", particularly of the sun and its beautiful glory. It is nighttime now, and he is asking the sun to replace the "pale" moon. For Romeo, the sun is represented by Juliet, and in asking the sun to rise, he is asking that Juliet show herself.
Later, Romeo offers to swear by the moon in order to prove to Juliet that he loves her, and she replies harshly, claiming that the moon is inconstant. So, if Romeo were to swear by it, then his love would be inconstant. Here is the quote:
O, swear not by the moon, the inconstant moon,
That monthly changes in her circled orb,
Lest that thy love prove likewise variable.
The moon is inconstant because it is always changing its shape. If Romeo's love is like the moon, then it will always be changing. Juliet prefers that Romeo swear by himself, as she considers him to be perfect.
It is interesting that Romeo has chosen to swear by the moon, when he himself was insulting it just moments before!