Cautionary note: I'm asking this from the mind-frame of someone who doesn't know much more than how to put tags together in some DFT code's input file and get a shining, all-hail-lords-Kohn-and-Sham energy per atom value as the output.
The important thing to keep in mind is that the Kohn-Sham (KS) band gap is not the fundamental/quasiparticle gap. Even theoretically. This is not an 'underestimation' of the band gap. They are not the same gap.
The fundamental quasiparticle (QP) gap is calculated as the difference between valence band maxima and conduction band minima, but for different hamiltonians.
A part of the exchange-correlation potential called the response potential has changed in a discontinuous manner as you've added the new electron to see where your conduction band minima is. That added electron has changed the hamiltonian.
I think this little bit is really a dominant pitfall (I'm sure there are many others). It helps to keep in mind that the KS gap is not the QP gap. Even with the 'exact' KS functional, you wouldn't get the bandgap that compares favourably with experimental QP gaps.
Almost the entirety of the above rant has been taken from:
As above, I'm sure there are many other pitfalls, but this is the one I like to keep in mind the most.
DFT is not applicable for computing the bandgap. If it gives it close to the experimental results, it is more or less accidentally. Usually, DFT is used as a basis set generator for subsequent computations based on GW theory or TDDFT.
DFT is by definition the ground-state theory - all Kohn-Sham theorems constituting the basis of DFT have been derived regarding the ground state properties. Also, there is no proof (at least I have not seen any) that Kohn-Sham orbitals can be somehow related to the excited states. The bandgap is a property related to the excited states though.