Chicago had a good bid, so did 3 other Cities. The IOC choice was not racism, but the reaction of the right was.
Chicago got the US Olympic Committee nod over San Francisco and Los Angeles. It had a better plan and was in 2007, when the Candidate Cities were short-listed, the most technically competent bid at the time. The decision to put Chicago forward to Candidate City Status was therefore right and was supported by the the President, G W Bush.
Of the applicant Cities, in 2007, Chicago had the better bid. Seven Cities applied to become Candidate Cities. Four were chosen.
Doha was excludedas a candidate City because it wanted to hold the Olympics in October (to mitigate the heat).
Prague did not have political support,President Václav Klaus even questioned the bid. Baku, Azerbaijan's capital had the highest level of residential support(91.9% backed the bid), however it had no previous International Sporting events and has won only 3 olympic medals. The long border with Iran did not help security considerations.
Of the Candidate Cities, Madrid had much to do to convince the IOC that a European City should be awarded the Olympics twice in a row (London 2012). That has never happened before. It will not in 2016.
The US bid was technically the strongest, in terms of planned finances, infrastructure and support (note - the Democratic Party did not run down an American bid), but a McCain sponsored Act that forbid taxpayer money being used to guarantee the Olympics raised questions about finances. The US has also held the Olympics more often than any other Country, so any bid from the US would have had to have been really special. The financial considerations and the memories of the Atlanta Coca Cola Games are a bitter pill. In addition, during the IOC "testing period", this did not help.
Tokyo had transport and security issues, however their bid was to "urbanise" the Olympics and have the Olympic Village right in the heart of Tokyo was seen as groundbreaking and as a result was seen as the strongest on technical grounds.
No South American nation has ever hosted the Olympics, but Rio's application was on the back of successful Pan-American Games hosted in the summer of 2007.
All Candidate Cities had upped their game for the final shortlist, that is why their Heads of State attended. A precedent from the 2012 selection, where all National Leaders were either present or gave a video endorsement of their support. Video messages for the New York 2012 bid were submitted by George Bush and former President Clinton.
The IOC is not racist. It may be subject to heavy lobbying, that even verges on bribery. However their processes are known and it is only right that the American President does what he can to support an American bid.
So well done to Rio. Brazil has become an economic powerhouse in the Americas. As President Lula da Silva asked, "do only rich countries have the right to host the Olympics?".
The reaction of the right though has been racist. Their reaction to the failure of a bid that would have ensured $billions invested in to Chicago, securing jobs and homes for one of the most economically hardest hit Cities in the US has been disgusting.