Shimming the gap takes out the play between the hub and the shaft that's causing the rattle and simply helps tighten up the fit to that of the white props and their hub. If you want to be more accurate, then you can shim both sides of the mount shaft to even out the seating of the prop and hence improve the balance.
I'm not actually certain that what DJI are doing by stuffing foam in the prop base is really resolving anything as the foam will compress or break down over time and the rattle will return. They need to go back to the prop and the mount and make sure *both* are in the right tolerance range.