Because the people riding them are also wanting to improve their health.
Very true.
Perhaps
@Lee gg is already a strong cyclist.
If so, an ebike is a waste of time for him/her.
But if your starting point is "I do hardly any regular exercise", an ebike is a viable option to get going.
Lots of other options, taking up a sport, going to the gym, buying a push bike.
But those options don't suit everyone, as the number of bikes abandoned in garages after a few rides demonstrates.
@summerdays has posted elsewhere about a friend thinking of buying an ebike to commute.
Sounds a good plan to me, about an hour's moderate exercise most days doing something - getting to work - you have to do anyway.