Sand Castle is a mini-event where you collect tokens by making matches with the matchables showing the token icon. It is required to pass the level for the tokens to count toward the reward total.
You can access the Castle of Treasures either from the Castle button on the left side of the screen or through the Event menu at the bottom.