"Can't", right? Otherwise it sounds like American at-will employment.
The law mandates that the firing notice period cannot be shorter than the resignation notice period.
If they are at the "fuck it" point, what's going to force them to be useful and productive during the forced 3 month notice period?
Nothing - beyond professionalism. It is common for knowledge transfer to happen in this time, and any outstanding vacation days are usually taken at this time.
There's a huge cultural difference between US and Europe (rest of world?) when it comes to going to work after serving notice. It appears the employer/employee relationship is more adversarial, so much so that the employee is not trusted/expected to do the right thing after being fired (or after they quit) - the whole "immediately getting escorted out of the building by security" is unheard of in Europe.
If you reach that you just put in the notice, take whatever vacations you have and then put in sick leave.
But 3 months notice is used for, so the company can hire a replacement for you, and you can help train him, and transfer knowledge.
A lot of people reading this site work in companies that have huge teams, but most people in IT I know from EU (where I live) are one or two person IT teams. 3 or 4 person team is considered almost medium sized.
In such situations you need yo hand of your task responsibly.
And that the one thing that will get you burned, if you leave your previous employer hanging.
You can still quit if both parties agree. I've done it before.
The clause is there to avoid this type of scenario where a key employee just says fuck it and leave.
It works both ways. So a company can say fuck it and fire you just because they want to.
It's a fantastic system. It can be exploited, but usually works really well for employees and it gives you a huge safety net you can (usually) rely on.