That's classic detonation. I's not caused by sand, unless the sand got into your carb fuel line. Its's caused by:
1) too lean a mixture, or
2) ignition timing not set correctly,
3) really crap fuel
1) can be caused by many things, badly adjusted carb, an air leak in the crankcase (were your head bolts loose?), crap in the carb filters, bad carb membranes, a fuel restriction in the supply line - e.g. primer bulb, or forgetting to open the tank vent valve, etc.
2) can happen if it was wrong from the factory, or the timing flywheel has slipped on the crankshaft (have that happen).
Make sure you have gotten all the metal from the bottom end of the crankcase out before you think about putting it back together again.