The quote refers to sodomy. AFAIK sodomy generally referred to every sexual practice and act that wasn't heterosexual and missionary style. So it wasn't just homosexuality, but included sexual acts that remain punishable to this day. So maybe Jefferson's and society's main moral failings at the time weren't so much their opposition to homosexuality, but their failure to distinguish between homosexuality and other sexual acts / practices.Additionally, Thomas Jefferson would likely wonder why all those gay men aren't in prison or castrated.