in this passage of moby-*ick, melville is developing the theme of obsession. the first part of the passage "sacrifice in the line of duty is noble" the author talks about nobles as a good character and also about sacrifice. if there is a duty and also a good cause it is good to fight for it and even if you die it would be admirable in our society. nobody can judge a person who sacrifices for doing what is correct.
in the second line "vengeance can become obsessive" is the perfect example of what happened to captain ahab. hunting and killing the white whale has taken over his life, he lost track of his own life in order to obtain his vengeance and that is not a good idea. vengeance is bad and it lead the character to suffer and pain even when they get vengeance, they feel empty they don't have a purpose anymore, their life lost the reason of existence.
in the third line the author talks about "commitment to a cause is admirable" this idea is similar to the first one, it talks about be the compromise to a good cause, it needs to be correct so it would be admirable. if you are committed to a bad cause as vengeance it is not admirable.
and finally in the fourth line "heartache is an unavoidable part of life" the author talks about death, we can't escape from death, it's our final destination in life and it's the end of everything. so we can obtain vengeance but if we die in the process it would be a shame.