It is in't asking for the passcode you enter, it is asking for your iCloud password.
This happened to mecouple things it could be.
You have a app that was loaded under a different iTunes account.
Your credit card for iTunes and/or iCloud need to be verified in that device: 3 or 4 digits and maybe the expiration date.