At one point in U.S. history, sodomy was illegal in every state. In the penal codes (no pun intended), sodomy was sometimes defined as anal sex, sometimes as oral sex, and sometimes both. In some cases, the laws applied only to same sex partners, in other cases to any two partners (even husband and wife).

This map (found here) shows when each state repealed its law:

In 2003, the Supreme Court made all such laws unconstitutional. This image (found here) shows which states had sodomy laws that applied to same sex couples and those that had laws that applied to all couples: