You are right God never changes, but man does
Man can grow in his understanding - as in the case of what leads to suicide. Slavery was a reality of life when Christianity was born. Later on in the context of the freedom we have in Christ, the movement abolishing slavery grew with time.
it wasn’t that long ago, just by being gay you were a sinner, but now with understanding it’s not a sin to be gay.
I believe - & I ask others to correct me if incorrect in this - that the Church distinguishes between the actual sin vs the attraction. A person can’t help who they feel attraction for, but they can act so as to not sin. This is in keeping with Scripture where St. Paul wrote in
1 Corinthians 6 NABRE (USCCB):
11That is what some of you used to be; but now you have had yourselves washed, you were sanctified, you were justified in the name of the Lord Jesus Christ and in the Spirit of our God.
d
Sexual Immorality. *12“Everything is lawful for me,”
* but not everything is beneficial. “Everything is lawful for me,” but I will not let myself be dominated by anything.
e13“Food for the stomach and the stomach for food,” but God will do away with both the one and the other. The body, however, is not for immorality, but for the Lord, and the Lord is for the body;14God raised the Lord and will also raise us by his power.
f
15Do you not know that your bodies are members of Christ? Shall I then take Christ’s members and make them the members of a prostitute?
* Of course not16[Or] do you not know that anyone who joins himself to a prostitute becomes one body with her? For “the two,” it says, “will become one flesh.”
h17But whoever is joined to the Lord becomes one spirit with him.
i18Avoid immorality. Every other sin a person commits is outside the body, but the immoral person sins against his own body.
*19Do you not know that your body is a temple
* of the holy Spirit within you, whom you have from God, and that you are not your own?
j20For you have been purchased at a price. Therefore, glorify God in your body.
They have a new identity in Christ - a new mind - a new way of life rooted to Christ.