I think an underlying issue here is that you're assuming there is an objectively correct way to play this game across all opponents (opponents, not characters). If someone can spam forward smashes against you and win, then in that scenario involving specifically you and that person, they played correctly; perhaps not optimally, but they still beat you.
The reason that mid and high level players do not engage in spamming attacks is because once an action becomes predictable, it becomes punishable. If someone is spamming, you need to figure out which move of yours is quick enough for you to run in and punish. If they keep spamming, you will win the match simply because the situation will repeat itself (attack is predicted --> punish --> repeat).