I think having England as the primary governmental template, followed closely by France helped a lot. I'm guessing Portugal and Spain were likely not as entrenched democratically and systematically as the other two and it caused longstanding issues. Canada is cut from much the same cloth as the US is and it succeeded as well.
There is a multitude of factors at play here, but the most prominent one isn't the specific country and its institutions, but the way nations colonized each country.
Portugal started the colonization of the Americas more than 100 years before England started, which means that they also had less experience on what was needed to make a colony work at that point.
Brazil and most of south america were insanely rich, so the type of colonization Portugal and Spain engaged in what was mostly exportation of national resources from the area, which ofc isn't conductive to building infrastructure and institutions that will help a colony transition into an stable independent country, I mean one of the most populous areas of Brazil is called Minas Gerais, which translates to "General Mines".
Main land Portugal despite having had one of the largest empires in the world with territories all over the world, was pretty small, which ofc means that if you want to exploit what is now one of the world largest countries, you would use a whole lot of slaves, a larger proportion to the non slave population than what you would likely see in something like USA, and since slaves don't tend to be educated even by the standards of that time, and its descendants would all around be discriminated against, it contributes to yet another issue.
Then we have the partners the US colonies had in comparison to what the south american colonies had, by the time of independence of the USA the british empire was very big and on the rise, same as with France, on the other hand the Portuguese and Spanish empire were already declining.
We can look at say the French and British colonies in Africa, and other regions and see that they also didn't fare so well, due to in large part the reason and way their colonization was conducted, in comparison we look at Macau a former Portuguese colony and it is one of the very wealthiest regions in the world, in no small part due to the fact it was built to be a trading hub, instead of a center for exploitation of natural resources.
That being said, Portugal and Spain culture and institutions have ofc played a part in all of it, it is certainly no coincidence that Portugal had the longest lasting dictatorship in Western Europe, followed closely by Spain