Strictly speaking, mandatory bosses are WoF, the three mech bosses, Plantera, Golem, Lunatic Cultist and Moon Lord.
Being more pragmatic with progression, the semi-mandatory bosses are also EoC, EoW/BoW and Skeletron (might be mandatory, see Aurora's comment above).
Optional bosses: KS, QB, Deerclops, QS, EoL and Fishron.
There are more strictly mandatory bosses than there are completely optional bosses.
That aside, Terraria's progression is difficult to modify. A hypothetical example: Once you defeat Plantera, you have to defeat EoL to get a key and unlock the temple. Adjustments like that don't really add much to the gameplay; it's just extending the boss runs. Trying to adjust the game in this manner would probably lead to backlash and personally I don't think it would add much value. Leaving many bosses as optional is the best of both worlds. Completionists and explorers get rewarded for going out of their way to fight more bosses. Those that want to speedrun or progress more quickly have the option of doing so too. There's no penalty for your chosen playstyle.