If you’re in prison for life, and you want to kill yourself because of gender dysphoria, providing you the medical care to avoid that is the humane thing to do. Period.
If you are an immigrant detained for 6-12 months before deportation, the the odds of this applying to detained immigrants is near 0, but let’s say 1% it does, this would be tailored at ensuring they can have the drugs they require.
Keeping people from shooting out the back of their fucking heads or swallowing a bottle of painkillers to end it all is always the humane choice.
Don’t worry, we could fund it all by just not administering a few death penalties (those are more expensive than life imprisonment).