TLDR: The energy was being used simply to heat the substance up.
Whenever something melts, it performs what is called a "phase transition", where the state of matter moves from one thing to something else. You can see this in your iced drink at lunch; as the ice in the cup of liquid heats up, it reaches a point where it will eventually "change phase", or melt. The same can be achieved if you heat up that water enough, like if you're cooking; when you boil eggs, the water has so much thermal energy it can "change phase" and become a gas!
However, water doesn't randomly become a boiling gas, it has to heat up for a while before it reaches that temperature. For a real-life example, the next time you cook something, hold you hand above the water before it starts boiling. You'll see that that water has quite a high temperature despite not boiling.
There's a lot of more complex chemistry to describe this phenomena, such as the relationship between the temperature, pressure, and what is called the "vapor pressure" of a liquid when describing phase changes, but for now just focus on the heating effect. When ice melts, it doesn't seem like its heating up, but it is. The ice absorbs energy from its surroundings (the warmer water), thus heating up the ice and cooling down the water. Similarly, the bunsen burner serves to heat up things in the lab, so before the solid melts in this case it was simply heating up the solid to the point that it <u>could</u> melt.
Hope this helps!