The whole thing to realize here is that the 'cost' is not an actual loss as in 'less money comes in'; it's a cost in the sense of 'this portfolio will perform less than we anticipated'. And if the interest that people pay is based on a certain overall performance, but now all of a sudden the performance needs to be adjusted downwards, then one might argue 'we were shooting for a 0-operation, but in the end we will have to spend money to make up for the good borrowers leaving'.
Here's another intuition that explains it: if the market is willing to finance the good borrowers at half the rate it takes to lend to everybody, regardless of their prospects of paying back; then only the bad borrowers will stay in the government-funded portfolio, reducing the performance that was originally estimated. Which is, if you've accounted for future earnings based on the original estimate, a loss when you have to write it down.
Now, y gets smaller because some people pay off their loans in one go, to refinance somewhere else (the whole presumption is that only those who won't default will refinance); the expected interest becomes zero. But x stays the same. So y - x gets smaller. Hence, your number in the 'assets' column gets smaller; a write down that is counted as a 'cost' at end of year. You do get y in the assets column (the money that is paid back), but without the expected interest.
In other words: non-defaulters will keep serving their debt, earning the lenders interest. Defaulters have to be written down, including the interest. The less non-defaulters there are, the worse the overall portfolio will perform. If you estimate a performance of x at year t, and in year t + 10 it turns out that you need to revise the performance to (0.8 * x), then that 20% is a write down - i.e. a cost.