UPDATE:
Xcode 5.1 appears to fix the dropdown so that it now shows a "(blah blah)" whenever two profiles have the same name. This lets you pick the correct one. Which is much better :)
Bitten by this a few times. Xcode5 shows "Provisioning Profile" as a single field, WHICH IS ALWAYS INCORRECT and Apple SHOULD NOT have coded their GUI like this (beginner mistake there from Apple).
In Xcode5 (no previous version), you have two values of "Provisioning Profile". This MUST BE set BEFORE you set your "Code Signing Identity". Obviously, since it has to be set FIRST ... Apple placed it SECOND on the list, 3 items BELOW the thing it has to be set "before".
(bonus points for terrible GUI design there...)
It's also broken: if you have two Provisioning Profiles for the same name, Xcode5 will only allow you to select one of them. To work around this, you have to use iPhone Configuration Utility to find the Profile you want, find the 30-digit "Profile Identifier" and copy/paste it into the "Other" value of the Provisioning Profile dropdown.
Your Provisioning Profile MUST have a value for "Debug" and a different value for "Release" (unless you build a custom mega-profile by hand, Apple keeps the two separate).
The Debug profile will often have the same-name bug described above - most people will be using Apple's auto-generated Team Provisioning Profile, which Apple incorrectly always names the same, for all Targets, in all Projects. (another bug in Xcode5).
Once you've set both values, your "Code Signing Identity" field will finally start working correctly. In fact, it works nicely: in most previous versions of Xcode, this field was broken, and the "automatic" selection rarely worked. In Xcode5, it can ONLY use code-signing values found inside the Provisioning Profile you've pre-selected - and so it seems to get it correct 100% of hte time.
(i.e. you can safely set it to "Automatic". In previous versions of Xcode, Xcode would often "Automatically" use a Distribution profile for a Developer build, and vice-versa, causing lots of problems)