In unix, I know that you have to be a member of a group to change the group owner of a file to that group even if you own it, but can someone please tell me why. I don't understand why you shouldn't be able to change which group has special access privileges of your file if that group isn't one your a member of.
Because if you are able to change ownership of a file to a different group with malicious intent, or even accidentally, you might inflict some hurt on others that you have no real relation to. But if you are member of a group, it means you have some skin in the game. And whatever hurts this group, might eventually hurt you. It is the same principle , why only root can change the ownership of files from one user to another. It is a security measure.
@Melburslan is correct in his explanation, but also left out one key factor. Quotas. If you were able to change the group membership to something you didn't own... you could effectively bypass possible quota limits. Additionally, this prevents security exploits with "setgid" bits. i.e. If you set the "setgid" bit on a file then change the group to something with administrative privileges that you are not a member of... you can start processes that you would not normally have permissions for.