Rabbi Shnuer Zalman of Liadi has a lengthy discourse (Likutey Torah Parshas Re'eh 26c), where he discusses this question. He asks how this statement in the Talmud implying that the creation of man was a negative thing correlates with the explicit verse in Parshas Be'reshis that "Hashem saw all that he created, and it was very good."
He sums it up the answer in the end as follows (my own free translation):
This is the meaning of "They counted and concluded that it would have been more "pleasant" ("נוח") had man not been created". It does not, heaven forbid, say it would have been "good" ("טוב") had man not been created, for that is impossible to say - the descent and creation of the soul from the lofty levels of purity to this lowly world are all for the sake of the tremendous ascent that will follow; incomparable higher than the levels the soul had obtained prior. However, this was not the ultimate purpose in the creation. Rather, we were created to serve Hashem and not to work for ourselves or for the sake of receiving reward. Therefore they said that it would have been easier and more pleasant had man not been created, although he would have not have obtained such heights, rather than entering this incredible fight with the evil inclination, and if only one could come out as unblemished as when he entered.
That is, certainly it is good that man was created. The Talmud did not say otherwise; only that it would have been easier had man not been created.
This post quotes a similar idea from Rabbi Mordechai Yosef of Izbica in Mei HaSheloach.