When I read news about the action of Swiss National bank of not keeping fix ration to Euro any more, I read in all articles, that it was too expensive for Swiss National Bank to keep the fixed exchange rate. I don't really understand how can it be expensive. Swiss N.B was printing Swiss Franc and selling it for Euro? Right? How can be expensive printing and having Euro for free?
From a central bank's point of view, printing money isn't free. Each 1 CHF created costs exactly 1 CHF - that is, it appears on the bank's balance sheet as a liability. They owe that 1 CHF to someone (the person they bought the Euros off - a bank). And whenever you owe someone money, there is always the ultimate belief that you can pay it back. Lose that and the bank fails, and the currency fails.
With central banks this isn't clear cut, since the money can only be "paid back" by destroying it, but the trust in fiat money relies on the solvency of the central bank. A sort of, "so long as you could pay it back, I'll never ask you to".
The SNB had been buying so many Euros (and other currencies) that it was sitting on foreign reserves worth about 85% of Swiss GDP. In the process it did make a lot of profit, but that can only go on so long.
In theory, if the SNB could have held out forever, then it could have beaten the ECB, and when the Euro eventually strengthened, unwound its position as a profit. But that would have involved the SNB conducting massive quantitative easing in the mean time, in order to supply the world with sufficient CHF to meet demand. Given that Switzerland is somewhat smaller than the Eurozone, it would have been a battle it was destined to lose.
Given that they knew they would likely lose eventually, it is better to lose now, when you only have 85% of GDP in Euros, than to lose later on when you have 850% of GDP in Euros!
Of course having a central bank that is completely screwed, would weaken the CHF, but they only want moderate weakness, no complete destruction of the currency!
[Update: the following answer starts with the assumption that the SNB achieved its peg against the Euro through purely monetary means, i.e. printing new CHF to buy EUR. Some support for this view can be found here.]
You are correct that it cost the SNB essentially nothing to print new SNB to buy EUR in maintaining the currency peg, and I think that "expensive" is a poor description for what was really going on. In particular, when you hear people characterize the size of the SNB holdings of EUR in terms of the size of Swiss GDP, keep in mind that the links connecting the SNB balance sheet and real Swiss income are rather indirect.
HOWEVER, there was a cost or risk associated with creating the currency peg, because peg had the potential to lead to bad things. Here are some things that could have happened:
Best case for SNB: The EUR becomes gradually more valuable in terms of underlying market forces, eventually eliminating the need for the peg. With it's accumulated EUR holdings from maintaining the peg, the SNB can then buy back all of the CHF that it distributed in creating the peg.
The EUR keeps fairly stable and the SNB maintains the peg indefinitely, also a fine outcome.
The EUR becomes volatile, perhaps experiencing hyperinflation, in which case it's unfortunate to be pegged to the EUR, as that could mean hyperinflation inside of Switzerland.
Even worse, the inflation rate inside of Switzerland could exceed the rate of inflation in the European Union if currency speculators build a CHF bubble around the mere possibility that the SNB may abandon the peg. Yes, this is circular, but it's not circular reasoning; it's circular reality.
The SNB abandons the peg completely, as actually happened, in part to avoid the potential for (3). In doing so, the SNB experienced huge nominal loses. Remember that the SNB was buying EUR at rates above 1.2 CHF per EUR. Upon selling its holdings of EUR, however, the SNB could get back only about 1 CHF per EUR, a nearly 20% loss on that investment. From the perspective of the SNB, it's just a numbers game, but there was a real underlying loss of wealth for Switzerland as a whole, since the foreigners who originally loaned EUR to the SNB can now walk away with a clean profit denominated in CHF.
So, to synthesize, maintaining the peg was never very expensive for Switzerland. The expensive thing was ending the peg! Of course you then ask why did they end the peg, and the answer is essentially fear of (3) above. EUR has been devaluing,and the Swiss feared further devaluation. They were being very cautious, since the EUR devaluation has been pretty mild so far, but it makes sense to act sooner than later: If they waited to remove the peg until the EUR was experiencing true hyperinflation, then the SNB would lose even far more than it did.