Your macaroons could spread only if the batter is too soft. A great solution is putting the coconut macaroons in the fridge before baking them.