Before Joffrey's birth, Stannis was indeed Robert's heir.
Joffrey's birth however changed the line of succession but Robert never revoked the title from Stannis.
Furthermore, Stannis has never been styled as the Prince of Dragonstone, even though technically he held the same position. The appendix of AGOT styles Stannis as Lord of Dragonstone:
- STANNIS BARATHEON, Lord of Dragonstone,
- his wife, LADY SELYSE of House Florent,
- their daughter, SHIREEN, a girl of nine,
- RENLY BARATHEON, Lord of Storm's End,
Note that both Renly and Stannis are styled as Lords. Targaryen Princes who held lands were always "Prince of X" e.g. Prince Baelor Breakspear was Prince of Dragonstone while his younger brother Prince Maekar was Prince of Summerhall.
George never said that Stannis was the Prince of Dragonstone. George merely said he was affirmed in the capacity of the heir and was made Lord of the Dragonstone.
You might also want to note that mere birth of an heir apparent to a King does not automatically make them Prince or Princess of Dragonstone. There is a special ceremony for that. Example we have is Rhaenyra Targaryen even though she was born before her father inherited the throne.
In 105 AC, her mother finally delivered the son that the king and
queen had both longed for, but the queen died in childbirth, and the
boy—named Baelon—only survived her by a day. By this time, Viserys I
was heartily sick of being hectored over the succession, and
disregarding the precedents of 92 AC and the Great Council of 101 AC,
he officially declared that Rhaenyra was Princess of Dragonstone and his heir. A grand ceremony was arranged in which hundreds of lords
knelt to do homage to the princess while she sat at her father's
feet. Prince Daemon was not among them.
TWOIAF-Targaryen Kings: Viserys I
Furthermore, not all Crown Princes hold the title of PoDS. Aenys Targaryen never held the title but still was his father's heir. Joffrey's case is similar to Aenys'. The term Prince of Dragonstone emerged due to the spare, Maegor Targaryen. Aenys used to be with his father at the Red Keep while the younger prince stayed with his mother at Dragonstone and became known as Prince of Dragonstone. Maegor was not Aegon I's heir, Aenys was.
The half brothers were never close. Prime Aenys was the heir apparent,
and King Aegon kept him close by his side. As the king moved about the
realm from castle to castle, so did the prince. Prince Maegor remained
with his mother, sitting by her side when she held court. Queen
Visenya and King Aegon were oft apart in those years. When he was not
on his royal progress, Aegon would return to Kings Landing and the
Aegonfort, whilst Visenya and her son remained on Dragonstone. For
this reason lords and commons alike began to refer to Maegor as the
Prince of Dragonstone.
The Sons of the Dragon
Even after Prince Aegon was born to Aenys, Maegor still retained the title of PoDS. When Maegor was exiled, only then did Aenys bestow the title on his heir.
Aenys seemed content to let the matter lie with Maegor's exile, but
the High Septon was still not satisfied. Not even the appointment of
the reputed miracle-worker, Septon Murmison, as Aenys's new Hand could
wholly repair the breach with the Faith. And in 41 AC, Aenys made
matters worse when he chose to wed his eldest daughter, Rhaena, to his
son and heir, Aegon, whom he named Prince of Dragonstone in Maegor's
TWOIAF-Targaryen Kings: Aenys I
Other than them, monarchs such as Aerys I and Aegon V never held that title either but their succession was due to unforeseeable circumstances so let's ignore that. And of course we have Prince Daeron (Maekar's heir) as well who preferred to be styled as Prince of Summerhall, instead of Prince of Dragonstone because he hated the place and called it "a gloomy abode".
The fact that Joffrey did not hold Dragonstone did not bother the nobles. Even Robb admitted that Joffrey and Tommen were still the rightful heirs to throne even as the North and Crown were embroiled in war.
"You cannot mean to hold to Joffrey, my lord," Galbart Glover said.
"He put your father to death."
"That makes him evil," Robb replied. "I do not know that it makes
Renly king. Joffrey is still Robert's eldest trueborn son, so the
throne is rightfully his by all the laws of the realm. Were he to
die, and I mean to see that he does, he has a younger brother. Tommen
is next in line after Joffrey."
Not to mention, Robert had reservations over Joffrey's succession which he voiced to Ned, claiming that Ned did not know the boy as Robert did and the only thing stopping him from abdicating was the thought of Joffrey on throne with Cersei whispering in his ear.
"Let me tell you a secret, Ned. More than once, I have dreamed of
giving up the crown. Take ship for the Free Cities with my horse and
my hammer, spend my time warring and whoring, that's what I was made
for. The sellsword king, how the singers would love me. You know what
stops me? The thought of Joffrey on the throne, with Cersei standing
behind him whispering in his ear. My son. How could I have made a son
like that, Ned?"
"He's only a boy," Ned said awkwardly. He had small liking for Prince
Joffrey, but he could hear the pain in Robert's voice. "Have you
forgotten how wild you were at his age?"
"It would not trouble me if the boy was wild, Ned. You don't know him
as I do." He sighed and shook his head.
Nevertheless Dragonstone's importance, however symbolic it was, effectively ceased to exist when Robert caved Rhaegar's chest in at the Ruby Ford.
So TLDR, Robert presumably did not revoke the title from his brother because:
- Robert had no interest in traditions and laws.
- Robert mistrusted Joffrey.
- PoDS had no significance in the new realm whatsoever.
- It is not necessary for a Prince to hold the title.
- Many Targaryen monarchs and their heirs did not hold the title either.
- Stannis never held the title of Prince of Dragonstone.