Credit scores aren't a measure of financial stability or trustworthiness, they're a measure of how much money the bank thinks they can make from you.
So if you pay off a loan early, then they aren't making money on your interest payments, so that negatively affects your credit score.