What about when Kirk, you know, blew up his own ship?
I suppose one could ask, though, if there is a difference in Starfleet's eyes between losing a ship as a result of an intentional self-destruct and losing a ship by other methods, such as an accident or in battle.
Presumably, Starfleet equips starships with self-destruct routines because they believe there are circumstances in which it is necessary and expected. Surely, then, every case of using the self-destruct sequence couldn't automatically carry a penalty for the commanding officer. How can you penalize someone for doing what they're supposed to do?
OTOH, a loss from an accident, or even a loss in battle, could be seen as the result of incompetence or doing something improper and could potentially result in disciplinary action. Certainly at least a court martial proceeding to discern the truth.