Some of what you wrote isn't true. It's also harmful from a psychological and dietary perspective to say things like this: "You can bike for 100s of miles and watch the calories add up - but if you go home and eat some pizza - you've wasted your entire day."
That induces guilt over what people eat and can lead to eating disorders (that really happens). Exercise is not a waste, just because you eat pizza afterward. The exercise has benefits for health despite what we eat. Over-focus on calories can also be problematic, but take this as an opportunity to learn about the benefits of exercise regardless of our diet.
If you expend more calories than you consume, you will not gain weight (there is a little fuzziness around the edges of that statement but it's broadly true). In other words and to be more precise, from a strictly caloric perspective, gaining adipose tissue while consistently expending more calories than consumed is virtually impossible due to the laws of thermodynamics. Biology is complex due to hormones, water retention, inflammation, and other processes that occur as we eat and have daily activities, but the overarching laws of thermodynamics hold true for us.
For example, if I burned 500 calories in a workout and then ate 300 calories of pizza, I would not gain weight. If I burned 500 calories in a workout and then ate 300 calories of broccoli, I would not gain weight.
Or, if my total caloric expenditure in a day was 2,200 and my food was pizza, sugary cereal, a hamburger, and one lettuce leaf drenched in ranch dressing but was only a total caloric intake of 2,100, I would not gain weight. I could develop some health conditions because of the what I was eating, but the exercise and caloric 'restriction' would counteract some, even many of them.
This doesn't mean pizza and broccoli are equally healthy, which is part of your point, but "calories out" >= "calories in" and exercise are associated with many health benefits, including longevity and quality of life, above and beyond the food we eat.
Again, food matters, it just matters less than calories from an overall weight and health perspective. That's at least true based on the current research in the field. This is important to know because it can help prevent weight gain. Diets and weight loss are notoriously difficult. Preventing weight gain takes work as well, but is relatively easier. A simple focus on keeping calories in <= calories out over time will prevent weight gain*. That's going to be true regardless of the food we eat and what quality of food we can afford.
It's easier to "obsess" over total calories than to "obsess" over what foods you are eating. My encouragement to my students when we cover exercise, diet, and health in one of my classes, is to focus first on general activity, exercise, and sleep (if you sleep less, you tend to eat more!) for health reasons, then focus on keeping "calories out" >= "calories in", then focus on the 'quality' of food -- more vegetables, healthy fats, proteins.
Prevention is much preferred over intervention. But if there needs to be intervention, the best diet is one you will eat and keep. That usually means keep what you are eating, just eat a little less of it. Rather than switch from pizza to kale and goat cheese, eat 2 slices of pizza instead of 3. Then gradually you can build in 'healthier' foods.
*There are some medical conditions and other issues and factors that complicate the picture, but the general principle is true.