Why would a government bail out private banks? If the private banks never learn from history and keep giving credits to it's clients for overpriced acquisitions, and then they enter default why would the government give them free money or buy those banks?

If I buy overpriced apples to sell them in my fruit shop and I fail to sell them, the government will not bail me out and pay my debts.

Just as my company running the fruit shop should go bankrupt, those banks should go bankrupt, other private investors should buy their assets and start doing better banking business, removing that incompetent staff who buy (or give credits for buying) overpriced things (in this case: houses).

On a first thought, that's my conclusion. And also on a second and third thought.

The whole point of default and bankruptcy should be to allow those competent businesses to survive and those incompetent to leave the sector and do something else. And that looks like a fundamental piece of a working capitalist system that encourages the players to be competitive. Therefore the bailout of private banks looks like a bonus for incompetence. Sponsoring incompetents doesn't look like a good option for making the banking sector work well and totally not suitable for restoring confidence of customers in such banks.

Example: If Compaq is selling bad computers and Gateway is selling good computers, then Compaq should go bankrupt instead of getting government subsidies in order to keep being incompetent. Their owners can try to do something else, like for example Barbie toys, maybe they can do it better than making computers. Gateway will buy their assets and they will survive and grow because they are competent.

I would like to know the arguments used by the governments for bailing out the banks, like for example in Spain where they gave 100 billion Euro for the private banks.
Because the banks are not loaning their own money but that of depositors. One may also argue that the depositors should know the risks and if their bank makes bad investments it is partly their fault so they cannot complain should they lose their deposits. But a functioning banking system is essential to the current economic system. The bankruptcy of a big bank would cause panic and banks runs, which because of fractional reserve banking would probably result in the insolvency of other banks, banks that perhaps made good investments but ones that cannot immediately be liquidated. After the closing of the banks considerably less savings would be deposited in financial institutions. This will hinder consumption because credit/debit card traffic would cease and getting investment funds would also be considerably more difficult.

So the governments have considered the damage the bankruptcy of a bank would cause to their economy and decided it is better to bail them out. ("Too big to fail.") Of course since banks have a very large revenue stream they can also afford lobbying for intervention as well, but this does not mean that the intervention is not beneficial to the public. Furthermore, if you lose your deposits you may very well (wrongly) blame the government, so a bail-out is also politically prudent.

If you are interested in what could be done I recommend reading about the Glass-Steagall act.

If you are not satisfied with my answer there are any number of conspiracy theories that offer unconvincing alternative explanations.