I’m absolutely sure that’s part of it. Where I live you can have houses across the street from one another vary in price by $40k because of what school they are zoned to (this is stupid, but true). I’m sure the same thing is true, for states - people will pay more to live there if there are better schools, better roads, better hospitals, etc. I think the federal Republicans are actually actively trying to punish this. They are ideologically opposed to public services working for people and want to damage their viability.
Though I think @mmascan was basically right to identify population density as a factor. Less land and more people sure seems like it would mean the land was more expensive, other things being equal. It’s clearly not the only factor, but I eyeballed the urbanness of states and it certainly looks something like the states with the highest property costs.