I have a very similar problem with CloudKit entitlements now :( Works in Debug in Simulator and device, but not when built using distribution profile, entitlements just don't end up in the final archive. Passes validation though... odd.
Did you by any chance solve this?
If not, there are a few things you could still check.
To make sure that your Xcode is not confused about which profile to use - go to Preferences -> Accounts -> View Details -> Right click on one of the profiles -> Show in Finder.
Now delete all of the profiles in that folder. We are doing this so that Xcode can't accidentally use the wrong profile.
To make sure that Xcode can find the most up to date profile, I would regenerate the profile again just in case (delete and re-add) with a new name. Then download and double click. (Downloading through Xcode can be flaky a times)
At this point it's worth checking that the provisioning profile does in fact contain the right entitlement keys. You can run 'security cms -D -i profile_name.mobileprovision' and check entitlements section. It should contain 'com.apple.developer.healthkit' key
Now you can go to Xcode and explicitly set code signing identity (will be something like 'iPhone Developer: ...' or 'iPhone Distribution: ...' - depending on how you are doing your testing). After that you can explicitly set the Provisioning profile - Xcode should be able to find it and show you the name of the profile - it should match the name you used in step 2. Make sure you set things correctly for Debug/Release (again depends how you are testing). If Xcode complains that it cannot find profile with specific id -> go to that folder where profiles were and make sure it's there, the filename will start with the id, then just restart Xcode, it should work after that.
If you are building actual archives or ipas, it would be good to know what entitlements end up inside those packages (you can open them up and check; for archive: archive file (right click, show package contents) -> Products -> Applications -> app name.app (right click, show package contents) -> archived-expanded-entitlements.xcent (text file); for ipa (similarly): rename to zip -> unzip -> Payload -> app name.app -> archived-expanded-entitlements.cent
----- EDIT ------
I've fixed my problem. I think my project file was in a weird state because I renamed things at some point in the past and had to update some entries manually in the project file.
I knew which step of the build process was going wrong. It was the ProcessProductPackaging step that took original entitlements and generated the .xcent file that was eventually used for signing.
For some reason, for Release configuration, Xcode was not honouring the location of my entitlements file, instead it just used the default template from the SDK, eg. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/Entitlements.plist
I couldn't figure out why exactly, but things seemed to work ok for Debug configuration. So I nuked my Release config and created a new one with a different name, after that the build process started to pick up my entitlements file. From the project file diff it still wasn't obvious why things didn't work before.