The TDA rules are of the opinion that the mere act of showing another person - any person - your cards is a violation of OPTAH:
67: No Disclosure. One Player to a Hand
[..]
One-player-to-a-hand is in effect. Among other things, this rule prohibits showing a hand to or discussing strategy with another player, advisor, or spectator.
I respectfully disagree. Enforcing "don't show your hand to anyone, ever" makes it logistically easier to prevent OPTAH, but merely showing your hand to someone who is not in the hand doesn't violate OPTAH if they do not in turn provide you with any information, advice, or commentary.
TDA rules don't include "Show one, show all." However, Robert's Rules does:
6. Show one, show all. Players are entitled to receive equal access to information about the contents of another player’s hand. After a deal, if cards are shown to another player, every player at the table has a right to see those cards. [..] If the player who saw the cards is not involved in the deal, or cannot use the information in wagering, the information should be withheld until the betting is over, so it does not affect the normal outcome of the deal. [..]
Here again, I respectfully disagree. First, note that strictly speaking RR doesn't address showing your hand to a spectator. Second, I contend that "players are entitled to receive equal access to information about the contents of another player's hand" is only valid for players
still in the hand. If a card is exposed, either deliberately or accidentally, to a player
still in the hand then fairness dictates that the card be exposed to all other players
still in the hand. But fairness considerations are moot outside of the context of the live hand. Showing a card to spectators can't affect the game, assuming OPTAH is adhered to, so showing a card to a spectator doesn't then mandate that it be shown to anyone else at any time, whether immediately or after the hand. Ditto with showing a card to a folded player, and ditto with showing a card to anyone at all once the hand is over.
Now, you certainly might like to
know what was in someone's hand, so that you can use that information in later hands. But you're not entitled to that information. A player who wants to claim a contested pot must of course show his hand, but otherwise a player who mucks his hand is entitled to keep it a secret. But it's
his secret to keep, and if he wants to share that secret with someone - if he wants to tell his buddies what he had and not tell you - then that's entirely within his rights. I see no reason why that shouldn't also apply to
showing someone his cards rather than simply
telling someone about it afterwards.
So, in short, regarding the OP's situation - while TDA rules say you can't show your cards to folded players next to you, and Robert's Rules say that if you do then you should reveal your hand to everyone when the betting is complete, in my opinion it's not at all a violation of the principles or spirit of poker and there's no compelling reason to forbid it.
... in my opinion.