How would that even work? From Popular Science:

Here’s the theory of why it would work: Viagra chemically relaxes muscles and opens arteries to help blood flow more easily. (To help it flow easily all over the body, but, you know, there’s the primary mission.) With the blood flowing more easily, oxygen moves to the muscles more easily, which can (theoretically) improve endurance during competition. That’s something like the idea that altitude training will improve your oxygen flow and help you move longer distances without tiring, which it does.

But it’s unlikely to make much of a difference.

Catlin also suggests that any improvement would be miniscule (although minuscule can sometimes matter). More to the point, athletes could gain that minuscule advantage elsewhere, without having to ask their doctor for erectile dysfunction pills. Altitude training, the process of switching between living at high altitudes and training at low altitudes, could improve performance by 1 to 1.5 percent. That doesn’t sound like much, but even that might be more useful than Viagra. Beyond that, illicit substances would make for a relatively major increase in performance, much higher than what an athlete would get from Viagra.

So if that increase is so small, why would athletes use Viagra? Because players have heard (incorrectly, maybe, especially in the case of football players) it increases performance, even if just a smidgen. That’s enough of a reason for some athletes. Plus, it’s not banned in competitive use. Without some major evidence, Catlin says, official organizations like the World Anti-Doping Agency won’t place a ban on a medication for a necessarily discreet problem. (“Excuse us, but we need to make a formal display of this condition before you compete.”)