Partly for the same reasons they consider control over their local capitalists necessary
Beijing pledged to prevent the “disorderly expansion of capital” (防止资本无序扩张) because “capital is an important factor of production in the socialist market economy”, according to President Xi Jinping (CGTN, 2022).
China officially still sees itself on the path to Communism, and/but with a good dose of nationalism added. Giving Western liberal (in the economic sense) capitalists too much power over the Chinese economy is clearly not in the Chinese leadership's plan [to their version of Communism]. And given how they've cracked down on Jack Ma's group for instance, giving too much power to their local capitalists is clearly also not in their plan.
Capital controls [on foreign capital] are part of the toolset of quite a few Asian nations however albeit to varying degrees. (The PRC's rated among the highest, according to that paper; the data only covers 1995-2005 though.) Most of these other countries might not see themselves on the path to Communism, so the imposition of [some] capital controls is a somewhat broader phenomenon.

So, it's a matter of degree. And BTW, [some] people think there has been massive foreign investment in China. That is actually not so much the case relative to the size of the Chinese economy.
FDI alone represents only a small fraction of less than 5% of total
investment in China.
And while that's from a 2008 paper, given that China reached a 25-year low FDI this year, it's probably still a good analysis. (Additionally, in more recent times, European FDI in China is mainly practiced by a "chosen few" [typically large] corporations, who manage[d] to strike deals with Beijing.)
There is also a 2nd aspect to this, namely that China controls it local capitalists too this way, by limiting their opportunities to [legally] invest abroad:
One of my favorite graphs to share is a basic one of China’s capital outflows over the last 15 years. People are typically surprised to see that between 2013 and 2020, the period of collective global astonishment that “China is buying the world,” the errors and omissions line—essentially money moving across borders in unaccountable ways, e.g., suitcases or casinos in Macau—moves with and very close to Outward FDI every year. So, on average, as much capital was leaving China irregularly as it was being invested overseas. This fact really displays the lack of trust between business and the state in China. [...]
For the Chinese economy, I argue that the regime is trapped between its desire to accomplish things that require markets, like the internationalization of the RMB, and its desire to limit the instability that markets sometimes bring. If the PRC wants the RMB to be a credible global currency, it needs to allow convertibility. But allowing capital outflows means that some domestic actors and some global actors may move money in ways that CCP elites dislike, whether expatriating assets or speculating or simply withdrawing money from China when its economy seems bound for trouble.
And as aside to the top-voted answer making this claim, the Bretton-Woods system was unsustainable. It wasn't abandoned as a result of a plot by liberals but because the US deficits [due to the war in Vietnam and what not] were already at such a level that manipulating the [BW] system à la Chinese had become very tempting for the US government. Except that other countries objected, and BW system was an international one, so other countries could essentially throw a spanner in the works.
the political actions of the United States captured attention as a cause of U.S. deficits and a stimulus to worldwide inflation much more than did the inexorable but less contentions process of economic catch-up in other countries and the associated changes in price structure. Escalation of war in Viet Nam led to a major increase in U.S. military expenditure, which affected the U.S. budget and the payments position. The gross military outflow of dollars largely to Asia, which had averaged less than $1 billion a year between 1960 and 1964, rose to an average of $2.7 billion in 1969 and 1970, despite attempts by President Johnson to close nonessential military bases and “Vietnamize” the war in Southeast Asia. At the same time, Johnson’s domestic reform agenda of the “Great Society” involved an additional sharp rise in government spending at home. Pushed by military and social objectives, the federal deficit rose from $5,922 million in 1964 to $8,702 million in 1967 and $25,161 million in 1968. The stimulatory effect of the deficit on domestic economic activity affected the trade balance: on the merchandise balance, the U.S. surplus fell from $6.80 billion in 1964 to $3.80 billion in 1967 and then almost disappeared ($0.64 billion in 1968 and $0.60 billion in 1969). The current account balance deteriorated in 1967, and became negative in 1968.6 As a result, the United States in 1968 needed to make its first drawing for balance of payments purposes from the IMF, although it remained within the gold tranche. There were new drawings in May 1970, and on August 6, 1971, just before the final crisis of the Bretton Woods system, a drawing of $862 million was approved.
From 1965, U.S. gold reserves fell steadily, leading to doubts about the ability of the United States to meet its dollar claims. Nervousness about the dollar was in consequence reflected in the gold market. The losses of central banks in the London gold pool mounted until they became unsustainable and the pool was obliged to stop operating in March 1968. The argument now presented by the world’s monetary authorities was that since the creation of the SDR, no further need existed for gold except for speculative purposes. “As the existing stock of monetary gold is sufficient, in view of the prospective establishment of the facility for special drawing rights, the governors [of the central banks of the Gold Pool countries] no longer feel it necessary to buy gold from the market.” In practice, the separation of the private market (in which gold might rise above $35) from the official markets in which central banks dealt made impossible a “private” run on the dollar through gold conversions. But private speculators, pushed out of the gold business, simply moved with greater energy to the currency markets.
The new U.S. administration that entered office in January 1969 had a rather different concept of foreign economic policy to that held by its predecessors. President Richard Nixon spoke exclusively the language of national power and national advantage. International cooperation appeared to be suspect; international agencies futile. [...]
Nixon’s achievement was to push to its logical and ultimate limit the role of the United States as a reserve center. There would be no need to consult with other countries on the creation of reserves or how they should be held. He viewed the SDR exercise with mistrust. But such a manipulation of the system would produce its first obvious result in the accumulation of vast surpluses in the international accounts of other countries. Eventually the United States would run into the problem that other countries would no longer be willing to make concessions: they would not promote greater domestic expansion or take specifically targeted measures to restrict their export performance. [...]
The United States adopted an extreme version of the policy politely referred to as “benign neglect,” but expressed in picturesque terms by the Treasury Secretary appointed by Nixon in 1971, John Connally. Speaking to the Europeans, Connally put the American position in the following terms: “The dollar may be our currency but it’s your problem.” An American audience got a cruder version: “Foreigners are out to screw us. Our job is to screw them first.”
Except the way other countries ultimately dealt with that was to decouple from the fixed dollar.
on May 10, 1971 Germany adopted floating unilaterally, even though both the Bundesbank President and the supreme German monetary policymaking body, the Central Bank Council, remained opposed. There was no doubt that this was a decision that came from the government alone, and that the central bank did not want to share this responsibility. The German measure defied all the warnings and was an immediate success in halting speculative movements into Germany. [...] Most countries followed the German and Dutch moves of May 1971 and stopped interventions in the exchange markets, meaning that in fact the dollar was in practice now floating against the major world currencies.
So yeah, BW ultimately collapsed because of a Nixonian/nationalist approach as the final nail in its coffin, but the underlying cause was a relative deterioration of the US economic position, which had its seeds already planted.
I'd give some quotes from on of my favorite expositions on the BW affair from the German side, but they'd end up being far too long and perhaps besides the point here, but in a quick summary:
Leaving the BW [in 1969] by adopting a temporary float was a last minute political compromise in Germany, taken by caretaker government.
Its main advocate in new Brandt-led government was also an SPD man (minister Schiller--he despised Nazi-style capital controls) who had ally in the Bundersbank's vice-president (although the bank's president of the time was opposed).
After IMF and EC pressure, the German government agreed to reverse course. They even adopted some French style capital controls in 1973, also under a Brandt government, but with a new minister (Schmidt) in charge. But this plan collapsed in two weeks after the Bundesbank had to make absolutely massive buys of US dollars (largest ever one day etc.) Nowadays this event is taken as a prime example of the impossible trinity.
The final European compromise that came out in 1973 was a lot like the later EMU/Euro. Brandt agreed to the "snake in the tunnel" joint float against the dollar (that also excluded the UK because of high their demands for joining.)
Final aside: the "deindustrialization" of the West had almost nothing to do with the collapse of the BW. Although the export-oriented reindustrialization of West Germany and Japan after WW2 had something to do with it, by desychonizing e.g. the West German economy from the rest of the West, in terms of inflation rates, by the 1970s. In particular, Germany managed to better handle the Great Inflation caused by oil crisis of the 1970s, unlike most of the West, and the US in particular. The Bundesbank lists this among their great achievements...

This [finally] gets me to my about the analyst cited by some Indian website: capital controls are not in fact required for an independent monetary policy. (To give some leeway to that statement, it only says that's that how China sees things.) A [reasonably] independent central bank [targeting inflation] through open market operations is an obvious alternative. Something that China will not really adopt since by its constitution everything needs to be controlled by the CCP on some level. But that is something that did come out of the BW collapse in most of the Western countries.