Because those are the rules of std140 layout. The alignment of a vec2 under these rules is 8 bytes. Therefore, the second vec2 must be at an 8-byte alignment within the layout of the uniform block. So the compiler inserts padding between the end of the float and the start of the second vec2.
You didn’t need to spend a day on it; you could just look up the layout rules for std140 in the standard. Since it’s a PDF, I can’t link you directly there, but searching for “std140” would get you to them easily enough.