HTC wants to make sure that no one has access to your stuff. The company implemented a security feature on the new HTC One (M8) that will wipe your phone and perform a factory data reset if the user inputs the wrong password or unlock code more than ten times.
Phandroid's Android Forums dweller Rob Jackson initially posted about the security feature, along with a YouTube video of it in action. Once Rob input his tenth attempt at unlocking the One, the device booted up to the initial setup screen. HTC does offer a warning and countdown of failed attempts, but there is no setting to entirely disable this feature.
Several forum members pointed out that the factory reset feature is typical of several other phones out there, including the original T-Mobile G2 and previous versions of BlackBerry OS. Stock Android 4.4 KitKat, on the other hand, will merely give you a 30 second timeout after several wrong attempts.