Every time you restart your phone, even if it’s after an iOS upgrade, the phone will ask you to enter the passcode. Touch ID has to be enabled again for purchases in the App Store. However, it happens at time that it will start asking for your passcode even though you haven’t restarted the phone. It isn’t a bug and there’s actually a good reason as to why this happens; it’s because you failed to unlock the phone with Touch ID.
If you fail to unlock your iPhone using Touch ID five times in a row your phone will no longer accept Touch ID and will insist you enter the passcode. It’s a security measure to prevent access to your information in the event of theft (or a possible mugging). Your phone will also insist that you enter the passcode if you haven’t unlocked it in over 48 hours. This is of course highly unlikely to happen because people do not normally go 48 hours without unlocking their phones. It helps in the event that you’ve lost your phone and someone else finds it two days later. In both cases, you have to enable Touch ID for purchases in the App Store.
If you’re wondering what constitutes a failed attempt to unlock your iPhone via Touch ID, it’s the ‘Try Again’ message that appears on the lock screen. To see it for yourself, use a finger that you haven’t configured with Touch ID to unlock your phone.
The five failed attempts have to be made consecutively. If you fail to unlock the phone three times but succeed the fourth time, the next time the unlock fails will be counted as the first failed attempt.