But often an airline has both for historical reasons and, once you have both, it sometimes makes sense to order both. For example UA originally had 737s (older generation). Airbus made them an offer they couldn't refuse for 320s, so UA bought them and finally retired their remaining 737s. It then merged with CO, which had 737s only, and the combined entity bought more 737s. It then needed more capacity and found a good supply of secondhand 320 family planes so bought them.
The point is that, over 30 or 40 years things change, circumstances differ and planning goes awry. During that period for UA it went through bankruptcy, reorganisation, merger and several recessions. All these events change the arithmetic and, for an airline of that size, with over 150 320 family aircraft and over 300 737 family aircraft, it's not too difficult maintaining separate crew and maintenance arrangements.
For a smaller carrier, the inefficiencies would be greater certainly, but the same considerations apply. However, having said that, it does appear that the best run airlines do try, in their shorthaul fleet at least, to standardise on one or the other (I'm thinking EZ, FR, Southwest, BA, LH (which is finally getting rid of its last 737s) etc.