We are trying to pay off our 20 years fixed mortgage after 12 years and when I called the mortgage company and asked for the balance (in my calculation is only 57000 of the principal left) the customer service tells me that I have to pay the whole balance with the interest. I can not comprehend why I have to pay the interest if I'm paying off the whole loan?
You owe them for the interest that has accrued since the last payment was credited to your account.
When you sell a house with a mortgage the settlement company actually gets the payoff amount for a few days after settlement, to account for the mailing of the check after settlement has occurred. If they get it there a day earlier the extra amount is refunded to you.
When a bank or mortgage company issues a mortgage, they are creating a future stream of profit for themselves (i.e. the future interest payment less their expenses). This profit stream is accounted for in their books, and sometimes the future profit stream is even sold off to other companies or investors in the form of mortgage backed securities.
If people cancel their mortgage, and pay back the outstanding capital amount, they are losing out on the future stream of profit already allowed for. In essence, you are taking something away from them that they hoped to keep.
It all depends on your loan agreement, but based on your description, your agreement probably says that early cancellation still requires to to pay for the future interest so that the bank / mortgage company does not lose out. This is regulated in some countries to protect the consumer, but not in all countries.
In summary: cancelling a bond early reduces the profits of a mortgage company, and they want to charge you for this.
I will bet you the value of your mortgage that the loan contract you read and signed (you did read it, right?), will spell out in meticulous detail exactly if and how the contract can be paid out early and what fees, charges and interest will apply if you do so.
In addition to interest that has accrued since your last payment, for fixed rate loans there is generally a break charge to compensate the bank if interest rates are now lower than when you fixed the rates (e.g. you borrowed at 5% and market rates are now 2%).
There are two possible answers to your question:
As mhoran_psprep says, they are charging you the interest that has accrued since your last payment. If you look at the outstanding balance, this is usually the balance as of the last payment, not including interest since then. So your payoff balance is slightly larger.
Some loans have a "prepayment penalty". That is, if you pay the loan off early, you still have to pay some portion -- sometimes all -- of the interest that you would have paid if you had paid it off on the original schedule. Check the paperwork on the loan. In the U.S., most mortgages have no prepayment penalty. But many smaller loans do, with the exact formula used varying.