Well sand has many benefits,as long as it is safely sourced(high quality chinchilla sand or sterilized play sand only)!
Firstly,there's sand bathing.This keeps the coat in good condition and along with a high quality diet and appropriate healthy extras maintains skin and coat health.Not only is this important for looking good,but for the sake of comfort for example itchy or greasy skin and fur can be quite uncomfortable
Secondly,sand can also provide a place to use as a toilet.This helps humans quite a bit,but it also can help hamsters if you can avoid inappropriate frequent cage cleaning much longer(although the best way to keep this minimal is appropriate substrate depth and a large cage preferably a square meter or larger for Syrians or half a square meter for most dwarf species with Chinese and robos being able to be kept in slightly less space in some situations).Stress from overcleaning is a very serious thing,and it can also wipe out good bacteria from the environment as well.An oversterilized environment isn't good for any creature(even humans)as it can also increase the chances of illness,whereas very slight routine exposure in most cases helps to develop immunity
Third and last,it is one of many forms of enrichment.Enrichment is crucial to having thriving captive animals,whether the animals are kept in zoos or kept as pets.You really want to have as much enrichment as possible,and as long as everything in the habitat is completely safe(nothing should be inedible,and if it is it must be chewproof such as ceramic and resin)and the hamster can move properly through the habitat there really is no reason to simply keep a basic setup in all but the most extreme of cases(which the majority of owners will not face).