Deductions & credits

Thank you.  I follow the ratio explanation.  If I did the math correct, this has resulted in a net loss for both the roof and the land, which lowers my overall tax bill.  There is a net gain on the house (which I can exclude from capital gains since I lived in the house for 2 of the past 5 years).  I'm all for the lower tax bill, but is it acceptable to have a loss on one asset and a gain on another asset?