Material and Common
You have learnt about both material and common nouns. Some nouns can be used both asmaterial and common nouns.
In the first sentence, we are talking about sand as a thing (object) and not a material.
Here sand is a common noun.
In the second sentence, sand is the material used to make Bowbow's castle.
Remember: - A material noun becomes a common noun if there is an article before it (e.g. the sand) or if the noun is in the plural.