Torture works for inflicting pain on individuals and creating psychological fear in their comrades. It also creates enemies as well, and puts your own people in potentially more harmful situations if they are captured.
As far as gathering useful information, does torture work? Maybe, maybe not. Someone may tell you everything they know, but they are going to say whatever they can to get the torture to stop, so you really can't be sure if it was truthful or not.