Membership 2 Pro - Invitation Codes

I have set up my site so that you must be registered to get access to portions of the site. However, the membership needs to be free, but also secure from just anyone creating an account and getting access to private information. I thought that it would be nice to implement the Invitation Codes, however when I test the registration just anyone can register and it never requires or asks for the code. How can I set this up so that people are required to enter the invitation code before registering? Can I do this and still have it be a free account?