The hooded robber is the scourge of both real banks and those on TV. One obvious thing to do is not allow people to enter a bank with hats, hoods or sunglasses. Every so often this comes up. Currently, Central Florida is making a push to do so.
Here'a a video broadcast that overviews it:
Moreover, there is no real penalty as the PD admits, "Individuals who do not obey this policy will not be refused service. However, they will be watched carefully by bank personnel and the bank will be placed on heightened alert."
Interestingly, one bank, BB&T objected, saying that it would be offensive to their customers.
Of course, this is not surprising. Telling hundreds of valued customers to take off their hats or sunglasses is a significant nuisance and risks turning off customers because many people, right or wrong, will not see this as protecting them but an implication that they are criminals.