Once a user is marked as deleted, their username becomes free for reuse. However, they still show up in user group listings, and their name links to the user page currently with that username, which could by now be someone else.
Moreover, the group membership editing functions are keyed by username, and that username no longer resolves to their user ID, so we can't remove the group membership via the API anymore. (And user undeletion is not implemented yet, so I can't fix this!)
I think likely deleting a user should remove all group memberships. If we have some way to reliably ensure groups never contain deleted members, so much the better, but if not we may also want to modify the groups logic to not show deleted users, or to flag that the user is deleted.