Sorry to be the bearer of boring news, but we do not sort the tag badges you've acquired in any particular way. We just fetch a list of them, intersect that list with the tags on the question, and remove any tags that the user participated in adding to the question. It then just takes the first one in the list, whatever that might be.
While that means the behavior of which tag badge gets selected is inherently undefined, it should be loosely based on the order that the tag badge itself was first created and inserted into the database (we don't keep all three classes of every tag badge for every tag in the database - they just get inserted once someone first earns them).
Here on Meta, that looks like this:
That the required tags mostly happened to be created in alphabetical order was just coincidence that gave the resemblance of being sorted. But because each site is different, this ordering would be different on every site where the dupe-hammer is being used.