Not certain, but I assume it's because some of the bacteria from your filter can also live in the substrate, and by disturbing it you are disturbing said bacteria. And because this bacteria processes the ammonia and you have disturbed it, it is not there to process the ammonia and therefore there is an ammonia spike