Given the points made in the other answers (that any payload on the first launch is at high risk of loss), it seems to me there's still something useful you could do lift on a test-launch like this:
Low value but high mass raw materials for something that will be assembled in orbit. Or water. Water is heavy but useful (as radiation shielding, and for humans to consume), and very cheap. By the time you build a robust container for it that won't slosh around and unbalance the Falcon Heavy, it's still pretty darn cheap.
This means the Falcon Heavy doesn't have to go near any existing valuable thing (like the ISS or any satellite) with the Falcon Heavy itself, or risk a Dragon orbiter for the rendezvous. Future valuable stuff can be launched (on better-tested rockets) to match the existing orbit where the raw materials are.
Fuel (e.g. for a Mars mission) would be the obvious choice, except that @StianYttervik points out that an explosive payload is a Bad Thing, making failure on the launchpad even more dangerous.
Presumably SpaceX thought of these possibilities, and still decided to do a publicity-stunt launch instead. They're a commercial company, and the value (to them in an economic sense) of this publicity stunt is well above zero.
Presumably it exceeds whatever they thought they could get from launching low-value raw materials. Or maybe nobody was interested in paying to have raw materials launched as the start of an orbital-construction project any time soon!
As others have commented, proving they can get a payload onto a Mars trajectory is pretty cool.