Housing shortages have eased in most states since 2020, as new construction has made apartments and houses more affordable.