The armed services needed to order more pistols. I've read various justifications for this from worn out 30+ year old M9 stocks to complaints from the users, to low inventories, etc. etc. With multiple justifications on-hand, there's no one answer as to why and various reasons will be highlighted by people wanting to make their own points. It's safe to say that the US needed to order more pistols.
With the money already spent by necessity, it made sense to evaluate new options instead of just ordering what they did 36 years ago. Beretta did initially submit the M9A3 as a parts-compatible improvement on the existing M9, which would have resulted in a lower overall cost. It was rejected early, seemingly because of the double-action/single-action (DA/SA). The language of the RFP implied that an always-consistent trigger was preferred, but barred single-actions. Beretta responded with the APX which was more seriously considered. I won't get into any of the other competitors or why SIG won, since that wasn't the question.
It suffices that the armed services needed more pistols. The M9 lacked the features in the specification. The M9A3 had the features required by the spec added on, but appears to have been ruled out due to the inconsistent trigger. The action type wasn't specified in the requirements, but there quite obviously were expectations with regard to the resulting "feel."