This teaches the folly of false economy; of failing to achieve one’s purpose by trying to save in a small detail; of marring an effect in order to avoid spending a trifling extra amount. A man who buys an expensive new overcoat and continues to wear his shabby old hat with it is spoiling the ship for a ha’p’orth of tar.
The Shorter Oxford Dictionary reminds us that ‘spoiling the ship’ should be ‘losing the sheep.’ Sheep is dialectally pronounced ship in many parts of England, and the tar was used to protect sore places on sheep from the attacks of flies.