Please clear my doubt. Why the deletion of Local security groups is recommended and what's the purpose to delete the security groups when you uninstall the SQL Server instance, completely?
I am not aware of such a recommendation. Can you point to where you saw this? You should be able to uninstall using programs and features or add/remove programs.
It is important to Delete the local security groups before uninstalling
SQL Server for SQL Server components. Deleting is possible only by Using the
Windows interface and a command line. The purpose behind deleting the local
security groups in SQL Server is that, by deleting this from secondary replica leaves
the primary replica in the restoring state, and changes are not allowed on the
databases. If you delete an accessibility group from a PC that has been
expelled or removed from the WSFC fail over group, the accessibility group is
just deleted locally.