The ban has never been on gay men per se, but on MSMs (men who have [anal] sex with other men). A large minority of gay men do not have anal intercourse, and about 1/3 of straight men in prison will have anal intercourse with someone at some point.
I think making the donation condition on "celibacy for XX period of time prior to the donation" is probably essential, unfortunately.
They only test blood units for ANTIBODIES TO the virus, not the virus itself--testing all units for the virus itself would be prohibitively expensive. New infections will therefore not show up, because you have to have the virus in your system for a while before your immune system starts churning out the antibodies.
And unfortunately, prevalence rates among MSMs are very high, much much higher than in the population as a whole---meaning that even someone who is (as far as they know) in a monogamous male-male relationship is still at statistically significant risk, because it only takes their partner cheating on them. If Dave's husband Andy cheats, there is a non-negligible chance of Andy's contracting HIV from the other guy, and if he does, then the risk that he will pass it on to Dave is high. Even if Dave is as pure as the driven snow, his lifetime risk of contracting HIV is unfortunately not tiny.
"Prevalence is highest in gay/bisexual men in London with an estimated 83 (credible interval 73 to 96) per 1000 gay and bisexual men aged 15 to 74 years." This is a really high rate, people. en.wikipedia.org/wiki/HIV/AIDS_in_the_United_Kingdom#:~:text=In%202017%2C%20the%20prevalence%20of,aged%2015%20to%2074%20years.
By contrast, the rate among prostitutes/sex workers in the UK is a fraction of this rate--this study found it to be about 0.3%. Most probably got the virus from sharing needles or long-term relationships with dodgy pimps/boyfriends who shoot up drugs. And there are pretty much no cases on record of prostitutes/sex workers in the UK passing it on to punters. It just doesn't really happen. Risks for vaginal intercourse in the general population (not prostitution) are even lower. www.avert.org/professionals/hiv-around-world/western-central-europe-north-america/uk
Technically, my husband could cheat on me, contract the virus from a woman, and pass it on to me, but the chances of his doing so are almost comically low in countries like the UK, because so few women are infected in the first place, and because women very rarely pass it on to men through vaginal intercourse even if they are infected.
It's different if you are living in a place like Uganda or South Africa where women do quite often pass the virus on to men as well as vice versa, resulting in chains of heterosexual transmission between men and women, or if you are injecting drugs. However, both those situations are also prohibited if you want to donate blood--you cannot shoot up drugs, you cannot have lived in places like Uganda recently.
In practice, if your blood titres show that you have ever had hepatitis (and a whole bunch of other things), your blood will be thrown out anyway, and again, this will automatically rule out over half of gay men who have been sexually active for a while.