"There are lots of nice things you can do with sand: but do not try building a house on it."

Here Lewis references Christ's parable of the wise and foolish builders, found in Matthew 7:24-27 and Luke 6:46-49, which is quoted below from the ESV.

“Why do you call me ‘Lord, Lord,’ and not do what I tell you? Everyone who comes to me and hears my words and does them, I will show you what he is like: he is like a man building a house, who dug deep and laid the foundation on the rock. And when a flood arose, the stream broke against that house and could not shake it, because it had been well built.But the one who hears and does not do them is like a man who built a house on the ground without a foundation. When the stream broke against it, immediately it fell, and the ruin of that house was great.”