While TV dramas were a little slower to promote positive LGBT themes, sitcoms paved the way with gay characters and, yes, same-sex weddings. Sure, many TV series relied on gay stereotypes as punchlines — and some still do — but there are several notable examples of comedies that put forward the idea of marriage equality as something admirable and necessary.
It's also worth noting the gap between the 1996 Ellen episode and the 2005 episode of The Simpsons. One possible explanation: In the early '90s, same-sex marriage was still something of a novelty. Gay people could partner up and call it whatever they wanted, essentially. But as marriage equality became more and more political, sitcoms shied away from it — until, of course, they realized it was worth coming out in full support.