Since the question is why David preferred Solomon, we may gain insights from more general history.
The custom of giving precedence to the eldest son grows up among monogamous families, which easily fall into an age-based hierarchy. As we learn from the history of the Ottoman empire and others, polygamous dynasties are more dynamic and unstable. The son of one wife won't regard himself as inferior to any son of a different wife. The competition over the succession will be fiercer, especially if the winner of the race is liable to secure the throne by killing his brothers. This happens later in 2 Chronicles ch21 v4. It is what Bathsheba fears in 1 Kings ch1 v21; "...that I and my son Solomon will be counted offenders" (RSV). Solomon himself tries to avoid taking this preventive action, but Adonijah leaves him no choice in the next chapter.
Furthermore, the father himself is very likely to favour the eldest son of the favourite wife, rather than the eldest son absolutely. In the law given by Deuteronomy ch21 vv15-17, ordinary men are warned off this kind of favouritism. That's how natural it is. It became a factor in the history of the Ottomans.
Adonijah is the son of Haggith, one of David's Hebron wives or concubines (2 Samuel ch3 v2). It's possible that she is no longer on the scene. Solomon is the son of Bathsheba. From the story in 2 Samuel chs 11-12, it is easy to believe that Bathsheba became David's favourite wife. Certainly, it was Bathsheba who received the promise about the succession, and Bathsheba who claims it in 1 Kings ch1. The boy himself must have been too young to be an active agent in that day's political drama (which also explains why the choice had not been announced beforehand).
So my answer to the question is that David gave preference to Solomon instinctively as the loved son of his favourite wife.
This does not clash with the statement that Solonon was God's choice. It just gives us an insight into the way God works.