Magnon diffusion theory for the spin seebeck effect in ferromagnetic and antiferromagnetic insulators