Cash is subtracted in the Enterprise Value formula because it's a non-operating asset and Equity Value (which is included in the Enterprise Value) implicitly accounts for it.
One way to think about it is that when one company buys another, the acquiring company would get any excess cash that the target company has which effectively lowers their purchase price. It's like if you bought a house for $1 million but the house had a bag of cash inside with $400,000 in it. Even though you bought the house for $1 million, you really only had to pay $600,000 since there was $400,000 in cash sitting in the house for you.
In the same way, any excess cash that the target company has on their balance sheet should be subtracted from the Enterprise Value (or the price an acquirer would have to pay) for that company.