That can be frustrating. Here's a link that has solid information just to double check and make sure everything is set up correctly. When Apple ships a phone, they leave settings like these in default mode. Have a look at this and make sure everything is correct.
A lot of verification codes come via short code. Some short codes are considered premium SMS and are charged per message. You might have a Premium message block on your account as well.