How can a material at a certain temperature have all of its molecules at the same energy?
A material at a certain temperature does not have all of its particles at the same energy. In the basic definition of the word, "temperature" is the average random motional (kinetic) energy of the particles of a material. (Thermodynamics gives a broader definition to temperature, but we don't need this definition here.) Did you notice the word "average" in the basic definition? Just because we can assign a single number to the temperature of an object that is in thermal equilibrium does not mean that every atom of the material is moving with the same energy because of the nature of averaging. If the average height of everyone in the room is 5 feet 9 inches, this does not imply that everyone in the room is 5 feet 9 inches tall. Some people will be 6 feet tall while others will be 5 feet 6 inches tall. The average of a set of a values only gives us a general idea of the group as a whole and does not tell us about any individual in the group. In the same way, the atoms in a material are all moving at different speeds and with different energies, even when the material has a constant and uniform temperature. Some of the atoms are moving faster than the speed corresponding to the material's temperature and some of the atoms are moving slower. A few of the atoms are moving much faster than what is implied by the temperature.