Leaving a job is weird. I'm in the process of leaving my job, now. In France, that process can take three months - yes, three months! When it is your decision to leave, three months is long.
If you are leaving for another job, you and your new employer are stuck waiting. Of course, your new employer might make it worth your while to buy your way out of your obligation, but if you have to wait it out, it's long. And your mind has probably already switched over to the new job.
If you have no job to look forward to, you will probably spend your time looking for it.
Whatever your future job situation is, you have a really hard time doing any work at your current job. In my case, if they were recruiting my replacement, I could be busying myself with that and then the knowledge transfer. I should be doing my day-to-day work -- at least updating existing documents.
Is it good for the company to hold you to these three months? If you are fired, they owe you the three months, but they usually don't want you hanging around, so they just pay you and let you stay home.
When it you who has decided to leave, are they really saving money by keeping you at work for your salary? I doubt it. If you could go on to your next job sooner, do you need the salary from this one? I doubt it.
As soon as you announce your departure, they should start looking for your replacement and hire that person as soon as possible so that you can spend some time together during a transition period. Then let you go. They'll have someone working enthusiastically earning his or her salary rather than a dead weight.