Well evolution doesn't follow a design, shit just happens, animals fuck and they are stuck with it. Usually we assume the trait is the one that made it easier to spread the genes but sometimes it's true, sometimes it's just random and the animal gets to pin some broad down and rape 26 babies into her.
Plus it's not like pheromones are ONLY in piss, women and men have them floating around in their genitalia and armpits and are not an independent developement, but something we inherited from monkeys and don't use as much, as they have very little social significance in our interactions and by themselves aren't gonna attract anyone like it happens for - say - some insects.
Plus human women have less use for pheromones as, since they have long and excruciating pregnancy periods and, once born, the kid is notoriously a little useless sack of shit, they used to need protection from men in tribes and groups. So they aren't just horny and ready to fuck during ovulation (when clearly they are hornier and readier) but throughout the period and even during pregnancy, this suggests that unlike other animals their horniness isn't controlled by estrogens but a mix of hormones including testosterone as well, making them far more similar to men than in most animal species.
Again, this mechanism aren't by design, they were random mutations and were passed because apparently women that had them didn't become sad prehistorical single moms or whatever.