The first formula you have given is the present value of the bond redemption exclusive of any coupon payments between T=0 and maturity date. It doesn't make sense to value a bond exclusive of any future coupon payments.
The price or value of any asset should theoretically be the present value of all of the assets future cash flows. Therefore coupons should be included in the calculation.
The first formula is basically to value a zero coupon bond assmuning semiannual compounding.
The second one is for valuing a coupon bearing bond assuming that the ytm is quoted in terms of bond equivalent yields. Of course, the final payment in the stream should be the face value.