The photon has a mass of 0, but it has energy because of its motion. When it is sucked into the black hole and becomes a singularity, it loses its energy because it is no longer moving. It is not possible for something to be sucked out of a black hole, so it has no potential energy that the kinetic energy could have been transformed into. If I haven't missed a point, then energy has just been destroyed. Everyone knows that it isn't possible for energy to be destroyed because of the first law of thermodynamics a.k.a. the conservation law of energy. Therefore I must have missed a point, because I am not ready to criticize famous scientists that have indefinitely more knowledge then I do. Please tell me what I did wrong :)
There are a couple of issues you might want to consider.
Firstly there is the slightly boring one that we physicists measuring the mass of the black hole are outside it, and from this position the photon never reaches the event horizon let alone crosses it. I don't want to go into this here since the subject has been flogged to death in numerous questions on this site, however from the perspective of an observer outside the black hole infalling matter takes an infinite time to reach the event horizon. Once the photon has passed by us, its gravity is added to the black hole gravity and the total attraction we feel to the black hole has increased by one photon's worth - it doesn't matter that the photon is stalled just outside the event horizon.
Secondly, you say When it is sucked into the black hole and becomes a singularity, it loses its energy because it is no longer moving. It's certainly true that photons can't be stationary, but there are two things to consider. Photons are readily converted to other particles, e.g. an electron-positron pair, so a photon doesn't have to just disappear when it stops. It can convert to other massive particles that can come to a halt. The other thing to mention is that we simply don't know what happens when matter hits the singularity. It's a singularity precisely because there is no way to calculate what happens at it. So you can't say the photon loses its energy at the singularity because we can't say anything about what happens to the photon at the singularity.
Please tell me what I did wrong
It takes General Relativity (GR) to describe black holes and, in GR, energy conservation is, well, subtle.
From John Baez's Relativity FAQ "Is Energy Conserved in General Relativity?":
In special cases, yes. In general — it depends on what you mean by "energy", and what you mean by "conserved".
So, in general, one must reason very carefully about energy conservation when the context is relativistic and, certainly, black holes and photons are relativistic.
However, it is the case that photons falling through the event horizon increase the mass, and thus, energy of the black hole. See this related question: Why do photons add mass to a black hole?