There is some syntax problem in the .htaccess file. The file .htpasswd does not exist in the path specified in .htaccess file. The permissions set on the directory where .htpasswd and .htaccess file exist are incorrect. The permissions set on the .htpasswd and .htaccess files are incorrect. Incorrect usernames in the .htaccess and .htpasswd files.
Syntax is very important.
See, What is the full UNIX pathname to check if the path specified in the .htaccess file is correct. To fix the file permissions problem check to make sure that the .htpasswd file does exist where you specified and check the .htaccess file for any misspellings in the AuthUserFile pathname. If everything is correct there, check the permissions on the directory where .htpasswd exists. These commands are for the John Doe example. Check the permissions on the .htpasswd and .htaccess files.