The department used to be sometimes involved in national defense, so they called it the Department of War. When they started using it to exclusively create unnecessary wars, they had to change the name to the Department of Defense.
…it was created in September 18, 1947 as part of a reorg brought on by difficulties encountered during WWII. Pretty good foresight on their part to realize they were going to need to start a bunch of unnecessary wars!