You have a few questions here. They mostly concern the energy loss due to friction. In this problem **there is no energy loss because of friction**. Friction is present between the rope and the pulley. This is *static friction*. It makes the pulley rotate. Energy is lost due to friction (dissipated as heat) only when there is *relative motion* between the surfaces in contact - ie *kinetic friction*. In this problem we assume the rope does not slip against the pulley - there is no relative motion. So **there is no work done by the system against the force of friction**, and therefore no loss of energy as the rope makes the pulley rotate. There might also be friction between the pulley and the axle on which it rotates. Work is done (and energy lost) in that case, because there is relative motion between the surfaces in contact - the pulley slides over the axle. But the question assumes the energy loss in this case is negligible. The tensions in the rope and spring are taken into account only if you are trying to solve the problem by applying F=ma. The alternative method (used by your teacher) is to apply Conservation of Energy. This method ignores the forces and looks instead at the work that they do, and the effect they have in storing energy eg stretching the spring or raising the mass.