Actually, most swimmers at this level of competition wear two caps. Dana Vollmer, who won gold with a new world-record time in the 100m butterfly, actually lost her outer cap in the pool on the return leg of that event.
Thus, the first reason; redundancy. These caps are latex rubber, which doesn't mix well with chlorine and will eventually degrade, and as Dana's swim shows, even a brand-new cap can slip right off. If the swimmer, especially a female swimmer, had only one cap, losing it and releasing their hair would drastically increase the drag they have to swim against in the water.
Second, as Rory states, a common (though not universal) way to put all your headgear on is to put one swim cap on, then put your goggles on, then cover the goggle strap with another swim cap. Not only does it reduce drag on the goggle strap (which is minor), it helps keep your goggles in one place (MUCH more important). I was on a swim team when I was much younger, and I lost count of how many times the shock of entering the water ripped my goggles right off my eyes. You still have to swim if it happens, but it becomes a HUGE distraction that can take you right out of the race. At your average junior swim meet, losing a race to your goggles is embarassing but not devastating. At the Olympics, it would be a heartbreaker.