Equally if you are able to take on a lot of debt without it lowering your stock price then that means that the market thinks you're going to use that new money in a smart way to grow your companies value and thus your company is more valuable. If the market didn't believe you would use the debt wisely, taking on debt will lower your stock price.
In the real world you effectively cannot change the amount of cash or debt you have without it affecting your market cap in some way, as all three are tied together in complex ways and this model doesn't offer any insight into how changing one value will affect the others or the overall value going forwards. Think of Enterprise Value just as the price tag of a company at any given moment in time.