It collapsed, because the physics engine told it to collapse

The bricks are affected by gravity, and if you build an unstable construct by placing the bricks unbalanced or build a skewed tower it will collpase. Like it would in real world...

Btw... got my scoring system working for building phase...