The GDP Deflator vs CPI comparison is not so much a question of which is better but rather which is more appropriate given the underlying economic variable that is being assessed.
The GDP deflator is used to compare measures of national income over time according to a common set of prices that are fixed at some arbitrary base year. The CPI, on the other hand, is used to assess the way in which the cost of living is changing over time according to a basket of representative goods and services that the average consumer spends his/her money on each month.
This may seem like a distinction without a difference since both measures account for price changes, but the items whose prices are being tracked are quite different, and this can mean that the two estimates can differ significantly.
The main advantage of the CPI data is that it does give a reasonable measure of the cost of living for most people. There are certainly some valid criticisms of the measure though, and there is plenty of evidence to suggest that governments manipulate the data at certain times in order to paint a rosier picture than might be the case in reality.
At the time of writing, the official CPI estimate in the US is 7.1%, meaning that consumer prices are estimated to have risen by 7.1% over the previous 12 months. In reality, most consumers feel that the true rate of consumer price inflation has risen much higher than the official figure suggests.
There are valid criticisms that certain items are unfairly accounted for; housing and real estate in particular is poorly accounted for with an artificial proxy called owner equivalent rent used instead. Whilst that particular measure certainly understates true housing and real estate price increases in the short-term, it is likely that the proxy variable will catch up to reality in the long-term.
There is less valid criticism in that the items measured tend to change from one year to the next, and some economists feel that this is done to skew the figures in a way favorable to the government. I believe this to be misguided, and that changing the items measured is necessary to take account of the changing pattern of consumer spending. For example, smartphones, Netflix subscriptions, Tesla cars and so on are all significant items today, but they did not exist in previous decades.
Similarly, quality changes need to be accounted for, and quality more or less always goes up. The implication is that some price increases simply reflect quality improvements and should not be included in a cost of living estimate.
The main weakness of the CPI is that it is a poor measure of domestic economic performance, because many of the items included are not even produced in the domestic economy, they are imported from other countries.
The main advantage of the GDP deflator is the reverse of the main weakness of the CPI, i.e., it does account for changes in the prices of domestically produced goods and services.
Theoretically this ought to make the GDP deflator a much better estimate of inflation for the Federal Reserve and the government to focus on when managing the economy, but for some unknown reason it is not used for this purpose, and the CPI is favored.
The main weakness of the GDP deflator is that it is a poor cost-of-living index since consumers do not spend all of their incomes on domestic products. This is precisely why the CPI is a better metric for this purpose.
Whilst the pros and cons of these two measures are clear and distinct, what is less clear is why our governments give so much emphasis to the CPI measure when conducting fiscal and monetary policy.
Given the advantages of the GDP deflator in specifically accounting for inflation of domestically produced goods and services, it is difficult to explain why we use the CPI as the main measure for assessing whether or not the domestic economy is growing at an optimal rate.
In fact, a large part of the reason why inflation has been so underestimated in the years since the 2008 financial crisis is that we have relied on the CPI measure alone, and the CPI includes a vast amount of products that have been imported from China and other low cost countries with abundant amounts of cheap labor.
The falling costs of those imported goods have somewhat offset the rising costs of domestically produced products, and this has led to a failure to recognize a growing deficit on the balance of trade that really ought to have been addressed decades ago.