The Harem of Aman Akbar, E. Scarborough. I can't believe this one hasn't been mentioned yet.
However, the main character does not gain a harem, rather the main character is a member of said harem. Close enough, right?
Setup: horny young man, aquires magic lamp, gains several wishes.
Initial result: three castles each with a princess or cultural equivalent, none of whom know of each other.
After their mutual husband gets himself into trouble while aquiring a fourth wife, the ladies band together to rescue him.
Final result: more-or-less happy group marriage. The implications are not explored.
It's light humorous fantasy adventure, and has elements of parody and fourth-wall breaking.
If I recall correctly, much of the humor comes from the fact that not one of the ladies is a stereotypical sultry submissive harem girl. They are all strong, capable, independent types. For example, the protagonist is rather better at combat then her husband. One of the others is a political schemer, and so on.