High levels of doping in WO3 have been experimentally observed to lead to structural transformation towards higher symmetry phases. We explore the structural phase diagram with charge doping through first-principles methods based on hybrid density functional theory, as a function of doping the room-temperature monoclinic phase transitions to the orthorhombic, tetragonal, and finally cubic phase. Based on a decomposition of energies into electronic and strain contributions, we attribute the transformation to a gain in energy resulting from a lowering of the conduction band on an absolute energy scale.