It is valid to consider the projected expenses when determining whether or not purchasing a home is a wise decision. Expenses are a key component for estimating your expected net profit/loss from buying the home.
Expenses and rents help determine the market value of a home. If an investor needs to decide between buying the home and buying a stock, they will need to evaluate the potential expenses associated with the home. For the investor, the home's value is the present value of expected rents minus the present value of expected expenses. This present value calculation is the link between the value of an apple (and cost of fertilizer) and the value of the orchard.
Also note that the value to you might be higher or lower than the value to an investor. You might love/hate the neighborhood for personal reasons. Your tax situation might be different. You might also just like owning (renting) due to the ability to alter the home (freedom to easily move).
There are multiple values for the same asset. This is the basis of supply and demand curves. If a homeowner believes their home is worth $1mn to them, but the highest bidder thinks it is only worth $900k, neither is wrong. It is just a preference! However, they would not transact. The supply curve has 0 quantity at a price of $900k and the demand curve has a quantity of 0 at a price of $1mn.
There are a couple additional issues to consider when doing these calculations.
First, people with paying $10,000 or more in state income taxes will not generally be able to use their property taxes to further reduce their federal income taxes. The State and Local Tax (SALT) limit prevents people from deducting more than $10,000 of state income tax + property tax + other state and local taxes.
Second, the standard deduction is now quite high. As a result, you might still take the standard deduction for federal income taxes if you have a mortgage. If you are not giving to charity or have other deductions, you might find that your interest expense is not helping you significantly reduce your federal income tax burden.
As an example, if a married couple has $10,000 of SALT deductions, $15,000 of interest expense, and no other deductions, their itemized deductions are only $600 more than the standard deduction! The interest expense would have almost no impact on their federal income taxes.
The above is for educational purposes only. Without knowing your full circumstances, I cannot say how much, if any, of it applies to you.