Salting removes excess water, preventing the roasted squash from being soggy. Look at these water droplets on the squash after it's been salted - it's important to remove that excess water for optimal results: