If brothels were legal, for example, sex workers would be able to work together for protection without fear of prosecution
I actually disagree with this and the law in the UK surrounding brothels works very well. It's not illegal to work in one only to run one.
You have probably come across the "two prostitutes working together then one of them goes to prison for running a brothel" argument, well I suspect there's more to it if that's ever happened like drugs or antisocial behaviour in general. It's not really considered to be running a brothel if both are doing the work. "living off immoral earnings" is a bit more than just working for sex with another woman.
Legal brothels or the dreaded "mega brothels" increase exploitation of girls by being able to demand more and more from them, attracting migrant workers who may or may not be completely consenting to it (who can tell), and the earning potentials are greatly reduced. Part of this reason is the fact that there is no fear from the owners of being closed down or reported. They are free to utilise economic market forces alone.
In Milton Keynes there was a well established set of brothels running for decades "House of Divine" and the lady running it looked after the girls because she knew if there was upset of any kind she would be reported by one of the girls. There was a familiar relationship with the local police who knew full well it was going on.
Eventually she went to prison for living off immoral earnings and all 6 (ish) were closed down. She had became too "blatant" about the operation, ignored requests from locals to be more discreet, but mainly because a lot of the girls got into a dispute with her over working conditions and decided to report her for running a brothel and bigged up a story of dispute. There's basically often more pressure to treat those around you with respect if you know what you're doing is illegal.