I can't imagine many professionals would do something damaging to their employer on the way out. Facing legal troubles right when you are looking for a new job seems very shortsighted.
Also, if you treat the people you are letting go as humans, they will be less likely to retaliate. Ironically, trying to prevent retaliation by treating them like they will retaliate is more likely to cause them to do so.
However, if you are laying someone off simply because the business if struggling, you presumably think they are trustworthy enough to employ. If you trusted them enough to give them the power before letting them go, you obviously trust them. If you are worried getting laid off will make them abuse that trust and use their access to cause damage, how could you trust them before you laid them off?
If your personel has an exit period of a few months, they can take their time to process what happened, grieve, and find a new job, without losing the house or healthcare. There simply isn't that much of a reason for revenge.
But bigger organisations give extra insurance. This covers e.g. avprivate or 2 person hospital room instead of multi person rooms. Or private care without waitung lists
Also, as healthcare is getting more expensive, the core package gets smaller. E.g. dental care was a victim in my country, preventative care is still covered but restorative probably not.
Sounds soulless, and for some it is, but there is no place for drama when the day comes.
Being good hearted will eventually backfire - that one employee who feels its very unfair to him, with right access can do so much damage to already faltering company it can even bring it down.
So its a precaution, because 1 (or 5) percent of people are vengeful assholes, and you often find out only when right buttons are pressed.
Severance package is always generous, ie my bank gives in such case 1 salary for every year worked, on top of mandatory 3 ones mandated by Swiss laws.