First of all, we're talking about pre-IPO startups, so you can't just sell the stock.
Second, talking about "company loses money because it gave equity to employees" is as non-sensical as saying "company loses money because it gave equity to investors".
You're not giving away equity, you're exchanging equity (at present value) for cash (from investors) or labour (from employees). They're both investors (investing either their money, or their time/skills), and by investing, they're taking ownership of any potential future gains or losses (and by letting them invest, the company is giving up that potential).