We did it to make margarine

In the 20th century, we hunted whales nearly to extinction. What possessed us?