To discourage the slovenly habit of standing with your hands in them. A gentleman does not put his hands, or anything, in his trouser pockets. The pockets are there for some unknown reason shrouded in antiquity. You may carry your handkerchief, wallet, and other items in a pocket of your jacket or waistcoat. Or have your servant carry them.