Why is melting ice an endothermic reaction?
Energy is gained. Note that it is NOT a reaction.
Water is a higher energy state, as the liquid can rotate and vibrate while solid ice can only vibrate. This means for ice to turn into a higher energy state (water) it has to absorb energy, hence it is an endothermic process with respect to the system (surrounding temperature decreases).