Set a user's group on a registration form using a hidden field
There's a couple of problems you're probably running into.


By default, assigning user permissions (either directly or via groups) requires the the currently logged in user to have the assignUserPermissions permission. It sounds like you're doing this from a front-end request, where I'm guessing there is no authenticated session in place.
User groups and permissions are applied in Craft after the user has already been saved, so even if you got by #1, your changes would probably be overwritten.  The events you should be listening for are probably onBeforeAssignUserToGroups and onAssignUserToGroups.


Of course, you can always write a custom plugin that has a controller action, point your form to it, and do whatever custom user saving logic your situation requires as well.