Why is "є" needed here?
It is not needed. "Ви знаєте, де лікарня?" is the most precise translation.
"Ви знаєте, де є лікарня?" translates to "Do you know where there is a hospital?" We accept it as an alternative with a similar meaning.
We have in Ukrainian language word "госпіталь" in means "hospital" too