moon is feminine apparently stems from the perceived connection between moon cycles and menstruation. 
In Lord of the Rings, however, people (and Elves, and Dwarves, and Hobbits) consistently refer to the sun as "she" or "her", and to the moon as "he" or "him".  I doubt that Tolkien was making a statement about gender equality, but I haven't the foggiest idea as to why he chose to reverse the most common traditional gender assignments for the sun and moon.  Does he say anything about this in his writing?

A:

It seems that in germanic languages, notably German, the sun/moon genders are "reversed" like that, as sumelic commented.
Die Sonne (sun, female)
Der Mond (moon, male)
In other words, your assumption that male sun / female moon is somehow "general rule" doesn'thave been thinking of most when deciding how Westron worked (the language that is always "translated" into English) is Anglo-Saxon.
In Anglo-Saxon, sunne (from which the Modern English word sun is derived) is feminine, and mona (from which the Modern English word moon is derived) is masculine.
In keeping with Tolkien's idea that the LOTR should be an alternative folklore for the English-speaking peoples, and in his general use of language (e.g. calling the world "Middle Earth", as the Angles and Saxons did), he has Westron being a predecessor of English, and so feminine sun and masculine moon is the obvious choice.

