Raijinken
mentions a very important point: the timing of your defensive maneuver is everything. Do it too early and you will be read and punished by something else. Do it too late and you eat whatever you were trying to evade.
A lot of this comes down to fear. Fear of missing the punishment window and the fear of uncertainty of when exactly you need to put up your shield or dodge.
So you roll to remove yourself from the situation. However, in rolling before you needed to, you choose an easy to do, yet high risk and only moderate reward option. You often cannot punish from wherever you rolled to, and you risk being baited and punished if you roll too much.
On the topic of defensive maneuvers, perfect shielding (shielding an attack in the first 3 frames of your shield being active) is extremely important if you want a punish of your own, especially because of the modified shield stun mechanics making stuff safer on regular shield in general.
If you can master perfect shielding on regular attacks, and not just projectiles, you will have many more options and become able to punish many more things that you could not through any other means.
One more option is to use an attack of your own to either cancel out your opponents' attack or hit them first. Sometimes, the best defense is a strong offense. Throwing out a disjointed attack should do the trick in at least clanking with your opponents' attack. At best, it will hit them first.
For example, Lucina's jab or Ftilt can easily stuff dash attacks of characters like Mario or Kirby. If you use a much stronger attack, like her Fsmash or something with transcendent priority like her side B, it will be even more effective (But oftentimes if you miss with these stronger attacks you'll get punished hard in turn).
You can also jab projectiles like Luigi's fireball or Diddy's banana.
Don't underestimate the effectiveness of your own attacks in stopping your opponents'.
Also, an important thing to do is
look up the frame data of characters that you are fighting. Understand when the hitboxes come out. Understand how long they last, and when it becomes safe to drop your shield and punish.
Go to training mode and slow the game down to half speed or 2/3 or something. Do your best to hold off on shielding/spot dodging until the very last second and get that perfect shield or perfectly timed spot dodge and punish. Or, experiment with the timing of your attacks to see what you can use to punish your opponents' attacks and hit them through their own.
Once you get more comfy with how all the attacks and stuff work at a slower speed, reset the speed to normal and do it all again.
I guarantee you will improve your defensive game and your punish game immensely if you can quell your fear of getting hit and master the timing of perfect shielding to get optimal punishes.
And you'll ditch your bad roll habit.