Washer Drain Pipes

Just received a new HE washer and dryer and we moved the old ones out and started looking at the washer drain pipes.

After doing some research online it looks like our dimensions are off on the weir trap. We have an S one.

From the Floor to the S Trap (where it connects to the drain line, not from the bottom of it) it is 23".
Our stand pipe is 18" and is 42" off of the floor.

I see that the weir is supposed to be 18" from the floor to meet code. I am curious as to why though. Everything i find just states that it is code. I know the code was done for a reason and curious as to why it should be 18" from the floor.

Besides meeting code, what is the reason for it being 18" off the floor?

Also, our new washer/dryer are front load and will be on pedestals, will we need the stand pipe to be more than 18"? If so why?

Thank you for all your help and advice.