.htpasswd asking for authentication on home page

Be aware, the AJAX file admin-ajax.php is in the wp-admin directory too. So I guess your site is using AJAX to send requests in the background to the admin directory. Clicking it away lets the AJAX request fail, but the error isn’t displayed.

Change the .htaccess to:

AuthType     Basic
AuthName    'YOUR_AUTH_NAME'
AuthUserFile PATH_TO_HTPASSWORD
<Files '*'>
    Require valid-user
</Files>
<Files 'admin-ajax.php'>
    Allow from all
    Satisfy any
</Files>