This would be kind of difficult to pull off because they'd have a hard time doing this in private and it could be at least considered indecent exposure if other prisoners saw I imagine?
But other than that, no it shouldn't be illegal, even though it probably is. If it can't be proven that any sort of manipulation is happening than yes it should just be assumed that it is consensual. Does it not seem kind of wrong to punish someone based on assumptions and not proof and hard evidence?
And... you don't see why your idea would be... unfortunate?