The WACC is the overall cost of money to the company. Discounting at the WACC checks whether or not the investment is covering the cost of the money being invested.
However we do not always discount at the WACC. It depends on the riskiness of the investment (using CAPM) and on how the investment is being financed. I do explain all of this in my free lectures.