Let’s start by saying that GRRM seems bound and determine to leave the question of whether Aegon IV actually wanted to name Daemon his rightful heir a mystery of history, so ultimately this is a bit unresolvable. At the same time, though, Aegon IV did go to some effort to throw the whole question into doubt.
It does seem that it was bound up in a lot of personal and political things. Personally, Aegon was horribly ill-suited for a relationship with Naerys, probably viewed his marriage as a puniushment from his eternally disapproving father, and had huge ongoing problems with Aemon’s relationship with her. Whether those problems were rooted in his ongoing Goofus and Gallant relationship with his Dragonknight brother, a genuine belief that physical adultery had happened (remember Lancelot!), or an undeniable truth that what we would today call emotional infidelity was going on, I don’t know. So when Daeron becomes so close to Aemon, I think his mind would be predisposed to look in that direction.
Moreover, Aegon IV was, like his historical counterpart Henry VIII, a former jock who had nothing in common with his son Daeron – whereas he showed a lot more interest in his sons Aegor and Daemon who were talented warriors. Thus, I think we could say that regardless of their paternity and legitimacy, Daeron was Aemon’s spiritual son and Daemon was Aegon’s spiritual son.
But, as I argue here, we can’t ignore the politics. Aegon IV was a veteran of Daeron’s Conquest who had a severe reaction to Daeron I’s murder (handing over Cassella Vaith to be executed), and then his son was married off to the Martells without his say-so. And as he grew older, his son’s Dornish marriage both gave him an independent power base with which to oppose his father and made him a vocal Dornish partisan who fought every attempt by Aegon IV to avenge his cousin’s murder and win glory for himself. What king or crown prince would look at a crown prince actively opposing him on public policy as anything but an attempt to supplant them? In that light, his son’s un-filial disobedience and quasi-treasonous love of the enemy would have seemed like political bastardy, even if physical bastardy could not be proved.
At the same time, Daemon had been raised by Daena the Defiant, who had shared his admiration of Daeron I. Daemon was a military prodigy who was every inch the Valyrian dreamboat that Aegon had been in his youth, who probably had been raised with the belief that it was his mission to complete the unfinished work of his uncle and father. Here was everything that Aegon wanted in a son and heir, and unlike his other dalliances, Daemon was indisputably Targaryen on both sides. The only thing preventing him from being the perfect heir was his bastardy, and a king could do something about that.