Ferrari's Lewis Hamilton cut a dejected figure after spinning out of Sprint qualifying at the Belgian Grand Prix.