To put it a bit more succinctly - the sunk cost fallacy.
https://en.wikipedia.org/wiki/Sunk_cost#Fallacy_effect