rigid body simulation - unwated spaces between objects
Firstly, check your scale. A stack of 5m tall blocks of wood will behave vastly different to a stack of 5cm tall blocks of wood - with forces that are orders of magnitude more powerful, causing more ‘bounce’ and inaccuracies in the simulation.

Secondly, expect some gaps and a certain amount of ‘settling’ at the start of the animation. It is very difficult to avoid all gaps without causing overlapping surfaces which can generate huge repulsive forces at the start of your animation. I suspect the scale of your model is simply resulting in the forces being so large as to cause collapse.

Thirdly, tune the Rigid Body properties. The defaults (60 steps per second with 10 iterations) provide for a very crude simulation. Increase your steps and iterations (eg, steps 600 and iterations 300 - or even higher if required) until you get a stable simulation without causing too much CPU overhead (more steps and iterations require more computation time).