What is so essential about sex? One usually speaks of sex for reproduction, when actually sex and reproduction are the precise opposites of each other. Reproduction is the process by which one cell turns into two, sex is the process by which two cells turn into one. You may be thinking at this instant, which is better overall? Well, in terms of evolution, sex has had more of an advantage. Here's why:
If two favorable mutations occur in different members of the population and they have sex, those two favorable mutations can come together in a single descendent. If they don't have sex, the mutations can never come together. In the end it turns out that sex can have a very considerable effect in accelerating the rate at which the population response to changing circumstances.
This data shows that a very few organisms have been asexual for along time, in evolutionary terms. A few organisms may have been asexual for perhaps thousands or maybe even tens of thousands of years, but there probably aren't very many organisms that have been asexual longer than that. Asexuality seems to work fine for awhile then the world changes, they can't change, and the population goes extinct. This seems to maintain sex, and that's why asexual species are rare and relatively young.
The most plausible guess that can be made at the origin of sex goes something like this.
The first stage was a population of haploid/diploid lifecycle. Possible part of the year they were diploid (with two sets of chromosomes), and then they became haploid (having a single set of chromosomes). There are circumstances in which it is beneficial for an organism to be diploid, mainly, if there was a lot of ionizing radiation about. If there are two copies of the chromosome set, an organism can repair DNA damage by comparing one set to the other. Haploid cells are at the disadvantage because they only have one copy, and if it is damaged, they haven't got another copy to tell them how to repair it. Yet, haploid cells do have advantages; for example, they can grow faster. This organism had the diploid/haploid lifecycle but no sex. When it had to go from diploid to haploid, it would simply undergo the process of meiosis, which halves the number of chromosomes. When it had to become diploid, it would simply double it's chromosomes without the cell dividing. This organism may have evolved to be replacing the process of doubling its chromosomes by fusing two haploid cells together. This is where the advantage comes in, if the two haploid cells have different mutation damage, when they fuse, they can cover up each other's weaknesses.
In asexual reproduction, a process of cell division called mitosis takes place. In this process, you start out with a parent cell. In stage one, the prophase, the cell's chromosomes duplicate themselves. In stage two, metaphase, the chromosomes align and prepare for splitting. In the final phase, the cell divides into two individual cells that are exact copies of the parent cells. Think of the process of mitosis as cloning.
In sexual reproduction, the process that each gamete comes to existence by is called meiosis. Meiosis follows similar steps as mitosis. First it undergoes chromosome replication in the prophase, the chromosomes then align with each other and prepare to be split in metaphase. Each of the daughter cells then go through the whole process again minus the prophase. By skipping the prophase, the secondary daughter cells only have half of the required chromosomes. This is what makes sexual reproduction the most unique. Now that the secondary daughter cell is done with it's splitting, it has the ability to meet with another organisms secondary daughter cell. This is the process that allows with gene crossing, which gives life to genetically different organelles.