We should never underestimate the value of surviving, surviving is what humans do, everything else (including sex) is just a footnote.
Recent theories suggest that sex is actually more important than survival. Read "The Selfish Gene". An example can be found in birds, where the males have very distinguishing colors. These colors are easier to spot by predators. But they also tell the females, look how nice my colors are -- I can execute my mating dance in the open field and not get caught by predators.