I looked at a few Maslow pyramids again and actually found one that puts sex as a basic need on the lowest level. I remember that there was a discussion about this during my studies and I can agree with the result. The level at which sex is placed depends on the individual situation.
I wouldn't describe sex as a basic need, it's eating, drinking, breathing (in my case, coffee). If sex was really a basic need in my case then I would be dead (which I obviously am not lol)
However, if having children ensures existence, then you can put it on the first or second level. But depending on the personality of the person, it can even serve to achieve the highest level of self-realization