It was allowed by the referee because the penalty is a direct free kick, so it can also be taken indirectly.
Det var tilladt i henhold til dommeren, fordi straffesparket var et direkte frispark, så det kan også blive taget indirekte.