He helped turn psychoanalysis from one of the most anti-gay branches of therapy to the first to endorse same-sex marriage.