I believe flags are sorted alphabetically by how they are internally represented. All flags are a combination of two special letter-symbols. For the UK flag, these two symbols are "GB", therefore the UK flag should be much earlier.
🇺🇸 (Flag of the USA [code: US]) ≠ 🇺🇲 (Flag of the US Outlying Islands [code: UM])
Yes, the first US flag, which most people pick, is actually the flag of the US Outlying Islands. Whenever you see someone use the US flag emoji, check whether they accidentally used the " wrong" one.
True, I realized this after posting. After quickly looking it up, it turns out they were added a few years later and differ slightly from the rest of the flags. According to the probably correct source of Emojipedia, you can see the difference here: