Sodium is a common component or contaminant in many compounds and its spectrum tends to dominate over others.  Thus the color yellow overpowers the true color.
The test flame is often viewed through cobalt blue glass to filter out the yellow of sodium and allow for easier viewing of other metal ions.
Flame Tests
Sodium - Yellow
Potassium - Purple
Barium - Green