Gonzalez played youth soccer for the Dallas Texans Soccer Club, and played college soccer at the University of Maryland, College Park, where he won the 2008 College Cup championship, was named to the NCAA/Adidas All-American First Team and First Team All-ACC and was named the ACC Defensive Player of the Year as a sophomore in 2007.
LA Galaxy
Gonzalez was drafted in the first round of the 2009 MLS SuperDraft by Los Angeles Galaxy. Gonzalez began a regular feature in the Galaxy lineup from the start, and scored his first professional goal on April 4, 2009 against Colorado Rapids. He was named MLS Rookie of the Year for helping lead the Galaxy from a last-place finish in 2008. In the 2010 season, Gonzalez scored a total of three goals including in the second leg of the Conference Semifinals. In January 2012, Gonzalez was loaned to 1. FC Nürnberg of the Bundesliga until mid-February. During his first training session with his new club, Gonzalez suffered a torn anterior cruciate ligament to his left knee after a collision with national teammate Timothy Chandler. He immediately headed back to the U.S. to undergo surgery. In August 2013, Gonzalez became Galaxy's third Designated Player after signing a new multi-year contract, rumored to be an annual average of more than $1.5 million. Gonzalez is the first pure center back to ever earn a Designated Player contract in Major League Soccer.
On December 22, 2015, Gonzalez was sold to Pachuca of Liga MX, ending his seven-season stay with the Galaxy. During their press conference with a Star Wars theme, Gonzalez was unveiled as Star Wars character Darth Vader in presentation and was given the number 30. Gonzalez made his league debut on January 8, 2016, in a 1–1 draw against Club Tijuana at Estadio Caliente. In his debut, Gonzalez registered an assist to Franco Jara to tie the match in the 43rd minute. On February 7, 2016, Gonzalez scored his first goal for Pachuca late against Pumas UNAM to salvage a 1–1 draw. Gonzalez won the Liga MX championship with Pachuca in his first season being a key player in the team's defense. At the start of the Apertura 2016 Gonzalez changed jersey numbers and was given the number 4 after the loan of Hugo Isaác Rodríguez ended.
Toronto FC
On June 3, it was announced that Gonzalez would join Toronto FC from Pachuca once the transfer market officially opened on July 9. He was signed using Targeted Allocation Money. He made his debut for Toronto on 14 July, against rivals Montreal Impact. He scored his first goal for the club on 29 September against Chicago Fire.
International career
On August 10, 2010, Gonzalez made his debut for the United States' first team in a friendly against Brazil. On March 26, 2013, Gonzalez was given the start in central defense in the United States' 0–0 draw in a World Cup qualifier against Mexico at Estadio Azteca in Mexico City. According to Jeff Carlisle of ESPN, Gonzalez "was the man of the match by a clear margin". Gonzalez was included on Jurgen Klinsmann's 23-man roster for the 2014 World Cup, Gonzalez started in the final group match against Germany, and the round of 16 match versus Belgium. On October 10, 2017, Gonzalez scored an own goal in the final game of the 2018 World Cup qualifiers against Trinidad and Tobago which resulted in a 2–1 loss which prevented the United States from qualifying for the 2018 World Cup.