The reason is simply that ammonia and nitrite is aired out of the soil. I read a study from the swedish farming university where they turned the soil in a concrete mixer for five minutes to reduce the ammonia in planting soil.
If you don't have access to a concrete mixer

I would suggest spreading the soil in a thin layer on a large plastic sheet to evaporate the ammonia.
Leave it overnight and you should have an easier start in the aquarium.