Prior to the release of the movie, director Christopher Nolan revealed in an interview that Bane's mask is used to deliver a constant supply of anesthetic. The character experiences constant pain that can only be made tolerable in this way.
Bane's pain stems from an injury suffered while he was imprisoned in The Pit. In retribution for helping Talia al Ghul escape, the other prisoners ganged up on Bane and gave him a vicious beating. The mask appears to have been developed later, after Bane was rescued from the prison by Ra's al Ghul and began working for the League of Shadows.