I read in a previous answer and it was mentioned in Sunday School today that members who are attracted to the same sex but remain chaste and don’t act on their urges, the same as heterosexuals, can hold a temple recommend. What about members that marry their partner in a state that has legalized same sex marriage? Given that they remained chaste until they were married can they still keep a temple recommend?
The law of chastity is simply that a man is not to have sexual relations except with his wife; and that a woman is not to have sexual relations except with her husband. With this understanding, homosexuals and heterosexuals can both worthily obtain temple recommends so long as they live this law. A few months ago The Church of Jesus Christ of Latter-day Saints gave instructions to bishops for the particular case you mentioned – whether it is sufficient to be lawfully wedded by the laws of the land.
“Changes in the civil law do not, indeed cannot, change the moral law that God has established. God expects us to uphold and keep His commandments regardless of divergent opinions or trends in society. His law of chastity is clear: sexual relations are proper only between a man and a woman who are legally and lawfully wedded as husband and wife. We urge you to review and teach Church members the doctrine contained in ‘The Family: A Proclamation to the World.’
Consistent with our fundamental beliefs, Church officers will not employ their ecclesiastical authority to perform marriages between two people of the same sex, and the Church does not permit its meetinghouses or other properties to be used for ceremonies, receptions, or other activities associated with same-sex marriages.“
Besides the principle in The Family Proclamation linked above, this also comes out from a distinction that the Church continues to make clear:
“The experience of same-sex attraction is a complex reality for many people. The attraction itself is not a sin, but acting on it is. Even though individuals do not choose to have such attractions, they do choose how to respond to them. With love and understanding, the Church reaches out to all God’s children, including our gay and lesbian brothers and sisters.” (MormonsAndGays.org)
There is no disciplinary action taken for same-sex attraction. There is no loss of temple recommend in such cases, nor disfellowship. Should the person choose homosexual actions then it comes with consequences. The Church recognizes such as sin. Marrying a partner of the same sex clearly falls under homosexual action, and any sexual relations had under that condition are against the law of chastity as far as God and the Church are concerned, opinions of the State and culture notwithstanding.
Even so, everyone deserves a baseline of respect, regardless of how his/her sins may differ from yours. As such, the Church reminds us that “ all visitors are welcome to our chapels and premises” to worship with us and participate in our activities. What’s more, we should still be civil and friendly whether attraction is same-or opposite-sex; whether such attraction is acted on or not; whether married or not. The Church “affirm[s] that those who avail themselves of laws or court rulings authorizing same-sex marriage should not be treated disrespectfully” (Church Instructs Leaders on Same-sex Marriage).