I've been able to find exactly two explanations:
The anomaly is because two separate Pauline letter collections were merged, one of which ended with Galatians and the other of which began with Ephesians.
The canonical order was modified from pure length order to emphasize the imprisonment theme common to Ephesians, Philippians, and Colossians.
The truth could be one of these two explanations, or a third option. The evidence, in my opinion, is not conclusive.
Option 1 is put forward by David Trobisch, in Paul's Letter Collection: Tracing the Origins (read chapter 1 here), as part of his broader theory of the development of the Pauline canon. Basically, he believes that there were three independent or semi-independent collections of Paul's letters circulating: one collection consisted of Romans, 1 and 2 Corinthians, and Galatians; another consisted of the other nine epistles traditionally attributed to Paul; and another (if you can even call it a "collection") consisted only of Hebrews, which in the early days was commonly attributed to Paul.
According to the theory, these three collections were later merged into one. There is no direct evidence of their separate circulation, but Trobisch's theory comes from analysis of the earliest extant collections of New Testament books (starting with the fourth-century Codex Sinaiticus and Codex Vaticanus). Among the manuscripts which contain the Pauline letters, there is remarkable uniformity in the ordering of the books. The order is substantially the same for all 14 letters (including having Galatians before Ephesians), with the following exceptions: Hebrews sometimes is between Romans and 1 Corinthians, sometimes between 2 Thessalonians and 1 Timothy, and sometimes at the end, and one outlier manuscript swaps Philippians and Colossians.
I found option 2 in the introduction to Christopher Seitz's commentary on Colossians. It's fairly self-explanatory.
One thing to note is that even if Ephesians came before Galatians, the Pauline letters would still not strictly be in order of length. In our modern Bibles, there are two (or three if you count Hebrews) divisions of Paul's letters: 1) his letters to churches, arranged in descending order of length with the exception of Galatians/Ephesians; 2) his letters to individuals (note here that the letters to Timothy are longer than the letters to the Thessalonians); 3) the probably-not-Pauline letter to the Hebrews.
So take your pick. Either there were multiple letter collections circulating, and the Galatians-Ephesians order is an artifact of the collections' merger, or someone decided early on that the imprisonment theme was worth emphasizing. Either way, I strongly suspect that the reason the books have remained in the same order has more to do with inertia than with any scribe's particular preference.