Tl;DR: All three factors are responsible for coloring of benzaldehyde (and pretty much any organics)
For the first two factors, I would mention the paper1 linked by @Andrew. Benzaldehyde is prone to atmospheric oxidation; the reaction is accelerated in presence of light to form primarily benzoic acid mixed other aromatics and polymerized aromatics causing darkening.
For the impurity aspect, let me quote the following from a paper2 discussing about benzaldehyde purification process:
[...] It is clear that traces of impurities, namely metals, influence markedly
the benzaldehyde activity. The active impurities present in pure benzaldehyde or
in that of anal, grade become visible after distillation leaving the distillation residue brown to yellow coloured. The criterion for the good quality of benzaldehyde is the colorless distillation residue.
My previous discussions:
- Phenoquinone vs benzoquinone
- Air- and light-sensitivity of phenol
- THE ABSORPTION OF OXYGEN BY BENZALDEHYDE, H. J. Almquist and G. E. K. Branch
Journal of the American Chemical Society 1932 54 (6), 2293-2302
- Benzaldehyde oxidation test, a model reaction with radical
mechanism. II. The purification of benzaldehyde and stabilization of its activity by
J. GAŠPERÍK, Chem. zvesti 29 (6) 808-810 1975 (PDF)