How can I create a field to hold data on users' countries and states?
In Drupal 7 you should use the dedicated addressfield module for that purpose.
The composite address field provides a country drop down box with other address fields such as state loaded via ajax depending on the selected country.
USA

Canada

It's a requirement of the Commerce module for address selection.
You can hide some of the address sub-fields if needed.