Move the blocks in such a way, that in a new place, they stick together. Only then they'll all disappear. The puzzle thief can only move the blocks when he can squeeze himself behind, so be careful how, and in which order you move the blocks.
Move the puzzle thief by clicking there, where you want to make him walk. Drag the blocks by holding your left mouse button after clicking on the block, and moving it.