I believe that some of the confusion therein lies with your adoption of the widely believed but reductionistic view of the brain wherein the fatty tissue between our ears inputs information encodes information and expresses outputs analogous to a computer.
Early research in neuroscience reduced the biochemical reactions of the brain and the highly interdependent functioning of the various neuroanatomical structures into such terms as being analogous to a computer because it was easier to understand its complex structure through those terms. However, as research has advanced within the field, drawing similarities between our brain and those of a computer have actually been viewed as insulting to the brain, as the inner workings of a computer are manmade and mapped out, yet the inner workings of the brain are far more complex, with much left to discover.
For example, early researchers in neuroscience put confidence in the belief that the adult brain was not malleable; you were born with a certain set of neurons and that number was fixed. However, in 1962, Joseph Altman discovered the concept of neurogenesis within the hippocampus, and the entire world of research was flipped on its head.
I say all of that to say that your statement of 'conditioning the mind' to respond to environmental stimuli reflects the influence that Pavlovian (classical) conditioning has played in your understanding of the brain. During Pavlov's time, behaviorists believed that people, and animals alike, and the brain that they possessed simply responded to the world around them through environmental stimuli through a feedback loop called 'conditioning'. As the science behind the brain became known, behaviorism was by and large disbanded.
So 'conditioning your brain' through environmental stimuli does not actually express the inner workings of the brain or what actually happens when habits are formed (whether those habits are positive like working out or negative like porn additions).