Healthy gut is a rather vague concept. What does that mean in clinical terms, and are there published studies showing that Whole 30 actually produces those results?
It means eating anything that feeds the good bacteria (commensal bacteria) in your gut: probiotics -> short chain fatty acids which is the fuel for these bacteria. That means fermentable fibers - vegetables, fruits, whole oats, mushrooms, barley.
It also means avoiding foods that feed the bad bacteria in your gut, which could lead to overgrowth of the bad and crowding out of the good bacteria. Refined sugar feeds bad bacteria.
In clinical terms, a healthy gut produces mucin, which is the lining or gut barrier, which promotes a healthy immune system (there are more immune cells in your gut than anywhere else in the body) and protects the rest of your body from endotoxin and inflammation.
There are lots of published studies and if you want to learn more, find a video online with Rhonda Patrick. She cites a bunch.