Mario, Luigi, Peach, and Bowser as stated by others are the 4 biggest characters in the Super Mario franchise so it makes sense to keep them.
Yoshi is the sole rep for his franchise, has been around since the beginning, and is still an iconic Mario character so he makes sense to keep.
Donkey Kong is another given. It was a hard choice between Diddy and K. Rool, but with how long K. Rool was requested for and with him being a villain rep, I chose him.
Pikachu and Mewtwo are both practically synonymous with the Pokémon franchise, and Greninja is both the most popular Pokémon in Japan as well as a more modern representitive of the series.
Link, Zelda, and Ganondorf all reflect the 3 pieces of the Triforce, and are the most iconic characters in their franchise.
Samus, again, makes sense to keep since she is the protagonist of Metroid. Ridley is a long time requested fighter and a villain so he makes sense.
Fox and Falco are synonymous with the Smash scene, and it would feel wrong to me to take either of them out. Wolf was cut to make space for other fighters and because he was already cut from Sm4sh for prior.
Kirby, King Dedede, and Meta Knight are all great representitives for their franchise and it was hard for me to choose who to cut, so I kept all 3 of them.
Inkling represents Splatoon, one of Nintendo's most iconic recent franchises. Isabelle is practically the mascot of Animal Crossing at the point, so while it could be debatable with one should be kept, in terms of "iconicness" I feel Isabelle wins out. Pit is both a retro rep and also represents Kid Icarus: Uprising, so I chose to keep him.
Marth was the first character chosen to represent Fire Emblem in Smash, so he was chosen to stay. Robin also has interesting moveset potential and because I feel Fire Emblem deserves more than 1 rep, they stay.
Sonic, Pac-Man, and Mega Man feel like go to 3rd party reps. Each one has a long history on Nintendo consoles, and as such I feel have earned their place here. Banjo & Kazzoie were long time request form many which in a better world, would have been in since Melee, so they stay. Finally, Steve comes from Minecraft, which is one of the best selling games of all time. It just makes sense to keep him.
If I could add five more fighters to this list, they would have been Wario, Diddy Kong, Charizard (alone since I count all of the Pokémon Trainer Pokémon as separate fighters), Snake, and the Mii Brawler. As is though, I feel like this is a pretty good 30 character roster. I like to imagine some of these characters would also get moveset revamps just to keep things fresh as well.
EDIT - Actually now that I think about it, if I could add in 5 more fighters they would actually be Ness, Captain Falcon, and Wario as veterans. Also Jack Frost and Conker as newcomers.