There are really two ways to look at this question. One way is "what purpose is served through the creation of man," which is what the other answers have addressed. The other way to ask the question is "what was Hashem's motivation in deciding to create man?"
This second question is what the Rambam describes as having no "real" answer. The Rambam writes in Moreh Nevochim 3:13, after pointing out the difficulties in identifying the purpose (תכלית) of creation, what the inevitable conclusion must be:
ואם תאמר אין זה לשלמותו אלא לשלמותנו, לפי שכך הוא הטוב לנו והיא שלמותינו, תתחייב השאלה עצמה ומה תכלית מציאותנו בשלמות זו? והכרחי הוא שיסתיים הדבר במתן התכלית שכך רצה ה' או כך גזרה חכמתו, וזהו הנכון
And if you will say that [creation of man] is not for the sake of His perfection but rather for our own, as this perfection is the best thing for us, this necessarily begs the question - what is the purpose of our existing with this perfection? And one must conclude by giving the reason that this is what Hashem wanted or this is what His wisdom decreed. And this is correct...
Indeed, answering, or even asking, the question would really be an infringement on the absoluteness of Hashem's existence and His kadmus (exclusive primordiality), as seeking a reason why Hashem would want to create the world implies the existence of something external from Himself which would influence His decision. R' Yosef Alcastille makes this point explicitly (in a letter quoted by the Shela"h in Beis Hashem):
ואם תשאל טעם לרצונו של מקום אתה שואל אם יש סיבה למעלה ממנו שתעורר אותו לעשות זה
And if you ask for the reason of Hashem's will, you are asking if there is a cause above Him which aroused him to do this.
I can't tell you for sure that the Rambam would include this in במופלא ממך אל תדרוש - that which is beyond you do not seek (Chagiga 13b, see Moreh Nevochim 1:32), but it certainly seems reasonable to call it such.