If the purpose is to exercise, I think badminton is more effective, whether it is body shaping or fitness.
But no matter what you do, there is a premise. For example, people around the age of 50 should play less badminton and increase table tennis, which is required by physical conditions.
Moreover, table tennis courts are more popular now, so it is easier to play if you want, and badminton courts are much less, because badminton courts need to be indoors and must be high enough and big enough.
There is also playing badminton. To some extent, it is an "aristocratic" movement. Buying balls, rackets, clothes and shoes is much more expensive than playing table tennis: we still have to do our best to exercise.
If it is not to improve the skills, and finally to participate in the competition, purely for physical exercise, then badminton and table tennis can be played, as long as they can exercise and sweat; For outdoor activities, it is more convenient to play badminton casually, and it can also facilitate interpersonal communication.