Laws also have two components - the spirit and the letter of the law. You can violate the letter of the law (for example sodomy) without violating the spirit of the law (preventing a sex act the recipient views as degrading). And as a result, you aren't prosecuted. The flip side is also true - you can also violate the spirit of the law, and not the letter of the law, and be prosecuted.
Sodomy laws aren’t prosecuted because they are all considered unconstitutional, not because some spirit of the law isn’t being violated. In an ideal world, they would have been cleaned up along with other archaic laws still on the books.