Technically life is also optional, just throw a toaster in the tub and get it over with.
But it's kind of a moot point to make because most of us still feel like we have some goal in life that we aspire towards. Similarly most games also have a goal and if you want to reach that defined ending then there are certain parts of the game that you have to complete, hence them being mandatory. When it comes to bosses like the Nameless king beating him isn't a requirement to finishing the game (compare to the soul of cinder whom you have to beat to get the endings), thus the boss is not mandatory and is instead optional.
My serious answer is that people like games which "reward exploration" but you can't have real exploration without the possibility of missing something.
I can't overstate how awesome Dragon's Peak was for me. Riding up the side of a mountain, jumping from peak to peak, red lightning crashing everywhere, climbing over entire mountains of dead dragons. And the payoff, the Bayle fight, was easily my favorite dragon in the whole game. Even better than Placidusax. It was like playing a Dio album. 10/10, give whoever worked on that bit a raise.
I'm convinced Elden Ring, until very late in development, required all 6 Great Runes to access the capital. It feels very strange for that much to be optional, both in terms of gameplay and lore, it was probably just thought to be unreasonably long in testing.