State laws prohibiting sodomy were on the books throughout US history until struck down by the US Supreme Court, which argued in Lawrence v Texas (2003) that the state cannot criminalize private sexual conduct.
With good planning and good will, medical professionals’ right of conscience and patients’ rights to controversial services can be both protected and accommodated.