When calculating the market value of debt we use the pre-tax cost of debt (because it is investors who determine the market value and they are not affected by company tax). When calculating a WACC we use the post-tax cost of debt (because we are looking at the cost to the company and the company does get the benefit of tax relief on the interest payments).