The Gemara in Masechet Pesachim (111) discusses the prohibition for a man to walk in between two women. Beyond the issue of Tzeni'ut (modesty), the Gemara mentions that a man walking in between two women can potentially arouse dangerous spiritual forces (Shedim).
Interestingly enough, a number of Poskim (Halachic authorities) addressed the question of whether this Halacha would apply to the deceased, as well. The work "Mishneh Halachot" discusses a case of a Torah scholar who was buried next to his wife, and then another woman was buried on the other side. As he was now situated in between two women, the children questioned whether they should perhaps re-inter one of the bodies, so that their father would not be surrounded by women on both sides. The "Mishneh Halachot" ruled that the Halacha forbidding a man to be surrounded by two women applies only to the living, and it was therefore forbidden to exhume and rebury a body to avoid this burial arrangement.
By contrast, Rabbi Moshe Feinstein (Russia-New York, 1895-1986), in his work "Iggerot Moshe" (Y.D. 1:241), claimed that the widespread practice is clearly to avoid burying a man next to any woman other than his wife. Doing so, he writes, amounts to a terrible insult to the deceased, and it is therefore permissible to rebury the body elsewhere if another woman was interred alongside it. He adds that this constitutes an implicit condition when the Chevra Kadisha (burial society) assumes responsibility for the interment, and thus burying a man next to a woman other than his wife constitutes a breach of contract. If this occurs, the burial society must see to it that the situation is rectified through reburial.
It is significant that the Rabbis afforded such importance to the concept of modesty, to the point where they deemed it improper to even bury a man next to a woman. How much more so must we, the living, ensure to maintain strict standards of modesty and avoid inappropriate contact with the opposite gender.
So it seems that the prevalent custom in our cemeteries is not to concerned with this issue of burying ladies next to men.