I totally disagree with what wolf63 has said. Every castrated dog I've had, my present one lost his crown jewels over 3 years ago, have been "lusted after" by non castrated mutts. It's a simple as that, and contrary to what wolf says, it most certainly is "a long-lasting problem."
However, big yankee, this "problem" is not of our making, it's those owners who do not have their dogs castrated who create this "problem", and dogs owned by responible people like you and I are afflicted by it.
The main offenders are either your breeder types or your macho man types. The breeder because their main priority is the �sd (pounds, shillings+pence) signs in their eyes, and the macho man who compares his dog being castrated to loss of his own manhood.
Either way, the onus should undoubtedly be on the owner of the "offending" dog to prevent it but it sounds from what you say that this infuriating problem usually falls to people like us to try to stop. It certainly is in my experience, and I've found myself dragging some rampant mutt off mine many a time while the owner stands looking on like a spare at a wedding.
So, the next time it happens to you, don't be afraid to give the human idiots both barrels because their dogs are only doing what comes naturally.