If you compare the cost of a mortgage, and a rent, they are very similar in Poland. So after 30 years you can sell the flat/house and you will get half of that money back. It's better than nothing.
Half, because usually the total mortgage cost for 30 years is about 100%.