Let's say you hold only 2 eggs. And you can only afford 1 blue incubator.
Go walk 15km.
With 5kms in red and 2km in blue, you'll hatch 6 eggs total.
With 5kms in blue and 2kms in red, you hatch 10.
To hatch that many the other way, you'll have to buy 2 incubators instead of 1.
But you are assuming that the only measurable thing here is total # of eggs hatched. I value speed (ie, egg turnover far more). Sure, maybe it's more economical from a total eggs hatched perspective, but I don't buy incubators because I want to be thrifty. I buy them because I want eggs hatched as quickly as possible. In effect, it makes no difference which way I use incubators. It literally has zero impact when using your 2 incubator example.
Using your example:
1) 5KM in red and 2KM in blue - In 6KM I would have cycled through 4 eggs, meaning I have 4 more shots at getting 10KM eggs.
2) 5KM in blue and 2KM in red - exact same eggs hatched in 6KM.
However, instead of using an arbitrary, either-or 2 incubator example, I'll expand it further and show my way is much better for speed and egg turn over. Let's say you have 3 incubators:
1) 2x 5KM in the blues and a 2KM in red (the apparent preferred strategy) - In 10KM you hatch 9 eggs - a full inventory cycled. But if you go the other way
2) 2x 2KM in the blues and 1 5KM in the red (my preferred strategy) - In 10KM you hatch 12 eggs. 3 more than the preferred, meaning 3 more shots at find 10KM eggs. This gap gets even bigger as you go.
So in effect, if you buy several incubators, you are actually better off putting lower KM eggs in the blue.