If there are unnecessary groups without members, Cleaner for Confluence permits to clean all empty groups with just one click.
To clean all empty groups: