The only employee I ever fired on the spot and locked out had started a competing business on the side and was actively poaching our customers+, other than that it always was amicably, whether I asked someone to find employment where they fit better or whether they found a place where they could do better there never ever was a reason to 'lock someone out'.
Admitted, this was a small company, at a larger company it might have been different because of rigid policies.
When I was employed myself (long long ago, fortunately) I usually ended up with some contract work from my ex employer to help them tide over until they had found a good replacement, in one case this period extended for 6 months.
edit:
+) To be fair, he actually emailed me last year, almost a decade after it happened that he was terribly sorry about what he did, so in the end even with him I'm still in contact of sorts, and I've forgiven him for what he did, he really seems to have learned his lesson.
Employees who are fired or laid off sometimes are locked out, but that's a more confrontational situation where the employer might fear retaliation.