This is due to Faraday’s Law. I will mathematically calculate the orthogonality between electric and magnetic fields in an electromagnetic wave using Faraday’s equation.
Complex exponentials will be used to depict the traveling electric and magnetic fields vectors, as they are easy enough to distinguish and integrate.
Let the electromagnetic wave vector be:
Let the electric field be:
The magnetic field is also:
Faraday’s law says:
We get the following results when we compute the curl of E, and partial derivative of B:
The left hand side of the above equation is analogous to a cross product between the wave vector and electric field vector and thus the equation can be written as :
The cross product is always perpendicular both to the vectors of the product. B equals the cross product of E and k, so B is perpendicular with both E and k.
This is why the magnetic field is perpendicular both to the electric field as well as the direction of propagation.