Generally, killing a hand should only be ruled as a last resort. This is especially true for infractions like this. In the case of an exposed hand, the hand should be played to a finish and the penalty should be awarded at the conclusion of the hand.
Whether or not to show the hand right then or after the hand is finished depends on the following:
If a player shows his cards to another player who also has cards in front of him/her then the hand must be exposed immediately for all other live players to see.
If a player shows his cards to another player who is out of the hand, then the cards should be shown to the other players after action is complete on the entire hand. (some rooms will say that a player must request to see the hand in this instance.)
The reason that a penalty should be assessed regardless if the other player has cards too is that showing cards violates a few poker principles. One violation is the "every player is required to act in his own interest" and the "one player to a hand" rule.
If a player shows his cards to an active player, it's pretty clear cut that action will be affected as a result.
If a player shows his cards to a player who is out of the hand, two things could happen: that other player could in some way advise the active player on how to play his hand, or that other player may get that information to a different live player somehow. Also, it unfairly gives that player an insight that other players don't have for future hands.
In the case of showing an inactive player, a warning or one-hand penalty could suffice for first offense, as the consequences of the infraction on the outcome of the hand aren't as severe.
regardless, this information should be told to all players before the start of the tournament.