This is a standard thing with UNIX-based systems. What's going on here is that homebrew requires administrative access to your machine in order to install properly. So what happens is, it requests those permissions with sudo. Basically, it wants your user account's password to check if you have permissions to request those permissions in something called a sudoers file. The same thing happens when you see the pop up when you want to make certain changes on your machine.
TL;DR: Homebrew needs administrative access, you need to put in your computer's password so the computer can approve the request.