A lot of different media tells differing tales on this. Some (unsurprisingly the ones that have them as protagonists) portray them as proud revolutionaries who wanted to keep away from the crown. Others (the ones where they're the antagonists) portray them as selfish gold seekers who wanted nothing but to expand their pockets.
Marcus Rediker, who wrote some of the most interesting history books on the topic of modern piracy, gives a non too obvious but still quite noticeable marxist view on the matter. You'll find his website here: https://www.marcusrediker.com/
To begin with I feel that a single short paragraph or two on "marxist historiography" is needed here. I know some people talk about "cultural marxism" in the conspiracy theory discourse and I have to make sure that the two are not mixed up.
Marx had strong views on history and he saw it as the most important science of all because it could explain every social movement according to him. He recognized that there were patterns in history and that they would repeat themselves. That's how he tried to predict the fall of capitalism. Those patterns were rooted in economic realities and that's why he focused on how wealth was distributed among a population. It lead to the very fertile field of "historical materialism" studies. For a full generation, especially in France, historians focused all their efforts in looking at the economic paradigms of past societies and how it shifted long term. The overall conclusion was that an open rebellion or a revolution would often if not always start when wealth was not equally distributed. However, many argued this line of thinking couldn't encompass all periods. The intellectual tools to understand and decipher the industrial age and the flaws of capitalism couldn't relate, say, to the feudal economy. All in all, marxist historiography has been heavily criticized over time and though some still would die on that hill it's a dying paradigm within historic studies. Most researchers have moved on from historical materialism to the study of culture and mental representations. We see this shift within the subsequent generations of the French very influential École des Annales, from Braudel to Le Goff.
More on the topic here: https://plato.stanford.edu/entries/marx/#4
According to Markus Rediker, the great navy companies were very capitalistic enterprises. Well, he's definetely right on that! As he sees it the golden age of piracy saw the opposition of two kinds of terror. The conventional social order, upheld by merchant navy companies, saw the fear of God as the ultimate weapon. God was the one who granted kings their titles and people their social status, the social order was therefore to be respected or God would punish you. Private property was paramount. On the other hand, pirates sought to disrupt the social order and they relied on a more libertarian and equalist paradigm: captains were elected, loot were shared, people from every origin could get in, it worked as a pseudo meritocracy. They spread fear by living outside the moral code and social decency. They were of ill-repute, violent and bloody. Markus Rediker insists however that their violence was the natural response to the violent capitalism implemented by the colonial system and big merchant navy companies. People had to work extreme conditions for a sub-par salary, or they could be slaves, or they could be massacred and disrespected indegenous people. Meanwhile the rich had their very risky capitalist ventures being payed off with crazy benefits.
This interpretative 'system' certainly helps to better understand the situation but it has some limits. Rediker, in my opinion, idealizes pirates as freedom fighters. He says in one place that their violence was the natural answer to the crooked capitalism of the time but he acknowledges in another that pirates booted out Benjamin Hornigold as their captain because he was not aggressive enough (Hornigold refused to attack English ships). Rediker doesn't take into account stupidity or greed. His explanation holds up because he writes about the pre-industrial era but we couldn't apply the same logic to medieval high banditism for example. Why did rogue companies plunder and ravage the countryside during the Hundred Years' War as they elected their own captains and shared their plunder? It couldn't be the "natural response" against some vicious form of capitalism. At least I don't think so.
We could nuance Rediker's portraying of modern piracy with the labelling theory and give it a more psychological touch. Why do people behave the way they do? Why would they chose to be criminals? When hanged in 1718, Thomas Morris bragged or wished he'd been one of the worst pest to have ever roamed the seas. It fits right into the labelling theory. Keep saying to someone that he's worth nothing or that he's a deviant criminal, he'll eventually not only believe it but also boast about it. This behaviour has been observed many times. It doesn't fit every psychological profiles but many people can react that way. It's even currently imperative for teachers or school educators to keep an eye on teenagers that could fall into that pattern.
No one could definetely argue that pirates were freedom fighters and nothing else but they certainly weren't in it only for the money. Too many risks were involved with that line of work. Most of the time you entered the navy because you were poor and desperate already. There was a very high mortality rate within the trade and fortunes were not easy to make. Blind hope, a poor wealth redistribution system and a lack of global education certainly helped people to choose that path in life despite the risks involved. The more we look at pirates, however, the more we have to consider them as individuals, each having their own reasons to launch a mutiny or to join an established rogue navy crew. I just want to conclude on the fact that the answer to your question may not be as black and white as you might think.