first a lesson you must have heard so a many times - "excess of everything is bad". and it applies to you too.
secondly, i must make it clear that masturbation
is a normal process and it does not have any deleterious effect on your health if you don't get addicted to this. you should not be ashamed of doing it but should controlthis habit of yours by engaging yourself in creative activities of your choice, games etc.
as far as the weight and hair loss is concerned, it is because you are concentrating more on this habit of yours and thinking about it rather than having proper diet. there is nothing better than a proper balanced diet to regain weight and prevent hair loss.
you can also consult a psychologist
to get over this habit, as he may guide you better.
Dr. Amit Kumar