In more serious games like Bioshock or Last of Us, I feel that boss battles can be detrimental to the game, if there isn't a good reason for the boss battle. It can be immersion breaking if a boss battle appears out of nowhere, "because it's a video game, and video games are supposed to have boss battles at the end". Shodan of System Shock 1/2, Glados of Portal 1 and Pyramid Head of Silent Hill 2 are examples of boss battles in more narrative driven&mature games that are perfectly fine. Or Shadow of the Colossus as a whole
In games that focus purely on gameplay, boss battles that don't have a purpose from the story/narrative POV are fine, but they should always challenge the player and put his skills to the test in my opinion. Like Glados of Portal, although it's not a hard battle, you must apply the skills you've learned throughout the game in that battle. That's the way it should be imo. A great boss battle should both have narrative importance and challenge the player that way, but naturally I don't expect that from older games, as long as the boss battle is creative and challenging, they're fine.
One thing I really hate is when platformers have a boss battle between every 3-5th stage. Although a platformer can have great boss battles and in some cases they're one of the main reasons people play the game (Mega Man, some castlevania games etc), I'm not usually playing a platformer to fight bosses, I'm playing it to jump around levels avoiding obstacles. This is more of a problem in PS1/PS2 generation platformers, not in 8/16-bit ones.
I really hate it when I get stuck in a great platformer game because of some too hard/unfair/poorly designed boss battle. Crash Bandicoot games, Pacman World and Blinx the Timesweeper are some examples of games where I enjoy the platforming levels, but where bad/mediocre boss fights can drain my motivation to play the game if I get stuck in those. Super Magnetic Neo is another one like that, though it's a not very well designed game in general, so the levels aren't any better than the boss fights.
