The sugar in soda is bad for your health in general so in that respect sparkling water is better. But teeth erosion comes from carbonic acid (CO2 dissolved in water) so it’ll lower the pH of sparkling water to cause erosion regardless of sugar content.
A lesser evil would be to carbonate mineral water that is softer (less acidic) because it contains a bunch of salts that will somewhat neutralize the carbonic acid. Commercial brands like Perrier have a pH of 6 which is close to that of tap water. But that adds to the cost compared to tap water. The best may be club soda which has added sodium and calcium salts enough to completely compensate for the carbonation. You can get somewhat of the same effect by just adding baking soda to tap water prior to carbonation.