Why doesn’t a squadron get allocated to do a mission for which it has the same preference as another squadron which __does__ get allocated to the mission?

Probably because of its preference for the mission for which it does get allocated (as generated by the allocation linear program). Here’s a simple example:

Preference You Me
1 Vanilla Vanilla
2 Chocolate Strawberry
3 Strawberry

We have 1 pint of vanilla ice cream, and 1 pint of strawberry. We both favor vanilla first, but since my preference (#2) for strawberry is higher than yours (#3), I'll get stuck with my second choice & you'll get your first choice.

To minimize the “cost” (the sum of the preferences), you get vanilla, I get strawberry.