From the administrative/IT point of view, I understand it entirely. It's a simple risk/value proposition. If an employee gets mad they were laid off (and that
does happen) and decides in a fit of rage to start deleting Slack channels, damaging or even just accessing production environments, deleting shared logins in the team password manager, downloading company/employee/customer/client data, stealing company IP, etc., they could seriously hurt the company. Even if what they do is illegal or you can sue them afterward, it's a very significant short term loss and in some cases, they may be able to do damage that cannot be reversed like deleting Slack channels.
Obviously, every company should have good access controls in place that would prevent this from a regular employee. But that's not always possible and at the end of the day, some employees have to have those privileges. It's easier to just immediately lock them out of anything and avoid any potential damage. It seems cold to you (and it probably is), but even one ex-employee going rogue before lock-out could be disastrous. And that's without going into the "ex-employee drags down team morale by ranting about company/job" aspect and in many cases insurance companies will require it. It's just not worth it, even at a much smaller company than DO like where I work.