It's not that hard to understand. An armed warship was heading back to reinforce their country at war. Thus, as an adversary, it was to be sunk at the next best opportunity.
I don't know why people have a hard time understanding that warships are targets, especially for submarines. Compared to schools, neighborhoods, hospitals and the likes, this is actually a fully justifiable action and the Americans would have been foolish to not sink the ship. Warfare is neither kind, nor fair nor particularly moral. Rules of Engagement and Conventions are a joke and everyone disregards them as soon as it suits them.
I'm also not surprised at all that there was no attempt to rescue the shipwrecked. Especially as it's a submarine, what are they going to do? Invite hostile combatants into bowels of their nuclear submarine? Exposing their position? No, they launched, they sunk, they disappeared.
The real shock (or to some of us, including myself not so shocking) was that India presumably lured them away from Iran, knowing about a US presence and ignoring the SOS calls, leaving the Sri Lankan authorities to respond and rescue the survivors.