It's mostly custom. The Mishna Berurah writes in 91:12 that during prayer
we are required to wear a hat because it isn't normal to stand before an
important person without one. A strong argument can be made that today we
are not required to wear a hat during prayer because today it is quite
normal to stand before an important person without a hat (most people
will speak to their rosh yeshiva without putting a hat on first). Even if
this is still a requirement the halacha would not require us to wear a
black hat (or, more accurately, a black fedora), a tan straw hat is quite
sufficient.
Nevertheless, the Yeshiva world wears black hats as a means of
indentification and it works quite well for that purpose.
Lazer
Eliezer C. Abrahamson
Abrahamson@juno.com
Talmud Torah - Basic Jewish Education
http://members.aol.com/LazerA