Either for Henry Gordon Bennett, an Australian lieutenant general who deserted his command and fled to safety during the Japanese invasion of Singapore, leaving his unfortunate troops behind to be captured, or for James Gordon Bennett, Jr., a New York newspaper proprietor and playboy during the late nineteenth and early twentieth centuries who became widely known for his extravagant lifestyle and shocking behaviour. The latter explanation is more likely, as the first time the expression appears in print was in 1937, in James Curtis's novel, You’re in the Racket, Too.
Regardless of the specific person who provided the name, the interjection is likely a minced oath, standing in for an exclamation such as God or (according to some sources) God and Saint Bennet, or even "God damn it".
The phrase fell out of use for some time, but saw a resurgence in the United Kingdom in the latter part of the twentieth century, perhaps as a result of its use by Derek "Del Boy" Trotter in the popular British sitcom Only Fools and Horses during the 1980s. It was used by Alf Garnett extensively in the TV sitcom "Till Death Us Do Part" filmed from 1965-1975.