Whether or not that was a decision directly made by Stalin, I don't know. But I do know that homosexuality was viewed by him and others in the party as a bourgeois decadence. Also, many people at that time in the world thought that homosexuality was a mental disorder. It wasn't until the 1970's that it was taken off the list of mental disorders for the American Psychological Association.
Most ML parties these days seem to be in favor of protecting LGBT peoples and in favor of allowing them to have sexual freedom, have partners, adopt, and so forth.