But the marines were hell bent on catching the Pirate King's son to end the blood line, I don't think they would of been cool with Ace joining the marine
And we've already seen Akainu's take on Absolute Justice, he would of definitely wanted to kill Ace whether he is a marine, pirate or civilian. Let's say if Akainu didn't get to him first, there are probably so many marines whose family were impacted/killed by Roger. They would of taken revenge by acting hostile or even try to kill Ace. If Ace became a marine, it would of been the same as turning himself in and disrespecting Rouge's effort of keeping him safe and away from marines
Whitebeard's last wish was to know if he was a good father. Then Akainu came and shit talked Whitebeard, Ace turned back, not for his pride, but to defend Whitebeard's last wish. To prove that he truly believe Whitebeard was a good father and he won't allow others to say otherwise.
While I do think Ace shouldn't have turned back, that is just the person he is and it isn't about his pride. Like Gol D. Roger, he will not let others insult those he cares about. Most of all, he didn't die from his confrontation with Akainu. It was because Luffy bent down to pick up a vivre card which left Luffy defenceless to Akainu's attack. Ace died to protect Luffy.