At the end of the day, it all boils down to the following.
No procreation. No sex.
There are plenty of species out there who engage in sexual behavior purely as a matter of procreation (sometimes even resulting in their own immediate death afterwards), without any element of "pleasure" involved whatsoever.
The simplest form of life of which I know, that has a sexual procedure, is a kind of algae called Chlamydomonas.
In its most common form, Chlamydomonas is a single haploid (meaning that it has only one set of chromosomes) cell, that swims around in a pond. Most of the time, it reproduces asexually, via mitosis, dividing into two new cells that are genetically identical to the parent cell.
When a Chlamydomonas detects that pond conditions are going to turn unfavorably, it does something odd. It seeks out another Chlamydomonas of the same species but opposite “mating type” (we don't call it a “sex” or “gender” at this level, nor classify them as “male” and “female”), and merges with it, producing a diploid cell (that is, one that has two sets of chromosomes). The diploid form of Chlamydomonas is a hardened, inactive, “resting stage”, that sinks to the bottom of the pond, and waits for things to get better. When they do, it undergoes meiosis, shuffling the two sets of chromosomes, and dividing into four haploid cells, which are similar to the cells that merged to produce the diploid cell.
The process by which two haploid Chlamydomonas cells merge, is the same process by which sperm and egg cells merge in higher forms of life, and the process by which the diploid Chlamydomonas divides into four haploid cells is the same process by which we produce sperm and egg cells.
Sex, at the cellular level, is all about haploid and diploid cells, and about these two processes by which one is produced from the other.
In Chlamydomonas, mating is done, not so much for reproductive purposes, but as a way of taking a form which is better able to weather adverse conditions. The shuffling of chromosomes, and related promotion of genetic diversity is a side benefit. And the two Chlamydomonas cells that mate don't die, they just cease to exist, having become part of the diploid cell that results from the union.
———
Paramecia have an interesting different sexual procedure. Paramecia are diploid. When two of them mate, their nuclei undergo meiosis, producing four haploid nuclei in each. They trade diploid nuclei, combine two of them, and absorb the extras. The rest of the cell structure is unchanged, so in a sense, you could say that it is the same two paramecia that swim their separate ways after the mating, but genetically, they are now the children of the two that entered into the mating. Genetically, the two original paramecia no longer exist.
“I'll tell you what a Paramecium is! That's the Paramecium! It's a one-celled critter with no brain, that can't fly! Don't mess with me, man, I'm a lawyer!” — Robin Williams as Peter Banning in the movie
Hook
———
In very low-level creatures, sex isn't so much for reproduction as for creating genetic diversity. There's one form of life of which I know that accomplishes this in a different way.
A variety of rotifers, of the class
Bdelloidea only exist as females, who lay eggs parthenogenically, that hatch to produce daughters that are genetically identical to their mothers. If there were ever any male Bdelloids, they have all died off.
Nevertheless, the Bdelloid rotifers have devised a different means of achieving genetic diversity, that is as effective as sex, and is a side-effect of another survival capability. Bdelloids have the ability, when they detect adverse conditions, to very rapidly dehydrate themselves and achieve a very tough, inactive state, in which they have an exceptional ability to survive extreme conditions, and then to revive when conditions improve. But this process damages their chromosomes, so on reviving, they have a means of repairing their chromosomes, often incorporating pieces of genetic material from the remains of other nearby creatures who did not survive whatever it was that caused the Bdelloid to go into its dehydrated, inactive state. In this manner, Bdelloid rotifers have a degree of genetic diversity comparable to that which other creatures of similar sophistication only achieve through sex.
———
It's only when we get to much higher forms of life that reproduction is exclusively sexual. We humans, of course, only reproduce sexually; but I think there are some animals as high up as fish that are capable of parthenogenesis. Of course, most plants can fairly easily be divided up, on plant asexually into multiple plants.
There's an interesting aspect of plants' sexual reproduction that few know about. The Chlamydomonas described earlier, though it's not very much like what you think of as a plant, is considered a plant. Note that it has two forms, a haploid form and a diploid form. In Chlamydomonas, the primary form is the haploid form, with the diploid form being a specialized “resting state”.
Lets go up the scale a bit, to moss.
The primary form of moss is still diploid. The little leafy plants that you mostly see as moss are diploid forms, called gametophytes. At some point in their existence, they produce sperm and egg cells. They don't do this through meiosis, since they are already haploid. The egg stays in a little chamber in the parent plant, while the sperm goes swimming off looking for an egg to fertilize. When the sperm finds an egg, and merges therewith, the product is a diploid plant, called the sporophyte, very different from the gametophyte. This takes the form of a tall, thin stalk, that grows up from the parent gametophyte whose egg was involved, tipped by a pod. Meiosis takes place in that pod, producing haploid cells called spores, which are eventually dispersed, and which grow into gametophytes.
[
Shown here: A small patch of moss gametophytes, with two sporophytes towering above it.]
All plants that have a sexual cycle, have this alternation between haploid gametophytes and diploid sporophytes. In moss, the gametophyte is the dominant form. By the time you get to ferns, the overall cycle is similar to moss, but now the sporophytes are the dominant form, with the gametophytes having been reduced to a small thing that you'd never notice unless you knew what to look for and where to look for it.
By the time you get to seed-bearing plants, the gametophytes have been reduced to just a few cells—the male gametophyte is completely contained in a grain of pollen, while the female gametophyte never leaves the flower or cone in which it is produced.