The reason it became a slur meaning "stupid or lame" is because the word was adopted by homosexuals in the first place.
Undoubtedly, but I found this to be interesting.
https://en.wikipedia.org/wiki/Gay
In modern English, gay has come to be used as an adjective, and occasionally as a noun, referring to the people, practices, and culture associated with homosexuality. By the end of the 20th century, the word gay was recommended by major style guides to describe people attracted to members of the same sex. At about the same time, a new, pejorative use became prevalent in some parts of the world. In the Anglosphere, this connotation, among younger speakers, has a derisive meaning equivalent to rubbish or stupid (as in "That's so gay."). In this use the word does not mean "homosexual", so it can be used, for example, to refer to an inanimate object or abstract concept of which one disapproves. When used in this way, the extent to which it still retains connotations of homosexuality has been debated.