Perhaps it is a little of everything. Some would say that torture is conducted because someone can.
Someone has power over another.
This is certainly a valid argument in many torture cases. Children torture animals often as a show of power. Charles Ng and Leonard Lake certainly got a perverse feeling of satisfaction and power over their victims in California. But torture can also be a means to an end. Some of the Nazi and Japanese torture of prisoners for medical research had a goal of trying to improve their ability to give medical care.