Castillo was born in San Luis Potosí, Mexico, where his father, a Uruguayan professional footballer, had played for the local team of San Luis.
The family moved to South America while Castillo was still a small child. He started playing for Uruguayan side Danubio's youth team. While playing in a Brazilian tournament, Castillo was spotted by scouts from European clubs. He went on to trials with Manchester United, but failed to obtain a work permit and the transfer did not materialise.
At the age of 16, Castillo's father and agent accepted an offer from the Greek club Olympiacos. Three years after he joined Olympiacos, Castillo became a regular starter in both domestic and European competitions. He became a fan favourite with the Gate 7 Ultras and was even given the number 7 shirt in deference to them. Castillo was part of the Olympiacos squad that won the next three consecutive league titles. He was the club's leading scorer during the preparatory phase for the 2006–07 season, accumulating seven goals in friendly games. He finished the season second to Rivaldo in goals scored and assists for the club, with three goals scored in five Champions League games.
In early 2006, his father and agent began negotiations with the Mexico club Chivas de Guadalajara, but talks were suspended because Olympiacos weren't interested in selling the player at the time.
Subsequently, in 2007, Olympiacos accepted Ukrainian club Shakhtar Donetsk's offer of €20 million for Castillo's services. Before this, in what Castillo correctly anticipated would be his last game for Olympiacos, he scored with a free kick shot, after "stealing" the kick from the team mate who was preparing to take it. He celebrated by running the length of the field on his own and throwing his shirt over to the fans at Gate 7.
On 31 July 2007, Castillo joined Ukrainian side Shakhtar Donetsk on a five-year contract for a fee of €20 million. This became the most expensive transfer for a Ukrainian club to date.
Castillo scored his first goal for Shakhtar while playing against SV Salzburg in the Champions League. He had only played in a few games for Shakhtar when, in a league match versus FC Naftovyk-Ukrnafta Okhtyrka, Shakhtar won a penalty kick. Castillo refused to give the ball to designated penalty kick-taker Cristiano Lucarelli and took the penalty himself, which was saved by the goalkeeper. Castillo was immediately substituted from the game. Coach Mircea Lucescu commented "What Castillo did, from a professional point of view, I've never seen anything like it before in my whole life. There will be some measures taken against Castillo".
On 15 December 2007, Castillo's agent told the Daily Mail: "There has been an agreement with Manchester City so that Nery can be with the club for one year on loan so he can prove himself and play active football," adding that City would have an option to buy Castillo once his loan period expires.
Shakhtar president Rinat Akhmetov stated that City's offer of £1 million was too low, instead offering "a one-year loan – five million euros and there will be no options, meaning a right to buy [Castillo]... If Castillo finds his game ... then in a year we'll decide whether to take him back to Shakhtar or sell. And the price could be 20, or 30, or 40, or 50 million euros."
On 18 December 2007, it was announced that Castillo had signed a one-year loan agreement with Manchester City, commencing on 1 January 2008. Reportedly Castillo was keen to make the move happen and, in a highly unusual move, paid half of the loan fee himself. Sven-Göran Eriksson commented "He was desperate to come to us, desperate to come to England, desperate to come to the Premier League", and said he had never seen a player pay for half the transfer deal himself before.
Castillo played his first game for Manchester City on 5 January 2008 in the third round of the FA Cup, away to West Ham United. However, in the replay on 16 January 2008, his first home appearance for the club, he was stretchered off after 32 minutes with a broken shoulder.
He ended the season with nine appearances, seven of them coming in the Premier League. Failing to secure a place at Manchester City, Castillo returned to Shakhtar Donetsk at the end of his loan in January 2009.
After Shakhtar Donetsk had failed to even include Castillo on the bench for the first two matches of the 2009/2010 season he was loaned to Ukrainian league rivals Dnipro Dnipropetrovsk for a year on 30 July 2009.
On 17 July 2010, the Chicago Fire announced the signing of Castillo as their newest designated player. He arrived on loan with Chicago holding the option to make the transfer from Shakhtar Donetsk permanent. In being signed as a designated player, he became the second youngest designated player in Major League Soccer history.
Castillo joined Aris on a six-month loan on 19 January 2011. He played his first game for Aris on 30 January 2011, against local rivals PAOK.
Castillo terminated his contract with Shakhtar Donetsk and signed a two-year contract with Aris on 1 July 2011.
He scored his first league goal for Aris of the 2011/12 season on 8 January 2012 in a 1–0 win over PAS Giannina. He scored his first brace in a 3–1 victory over Doxa Drama on 22 January. He scored his second consecutive brace seven days later in a 2–1 win over Levadiakos. Castillo scored again on 5 February in a 2–0 win over Xanthi, bringing his goal tally to six.
On 14 June 2012, Castillo's moved to the Liga MX club Pachuca on a three-year contract. It was the first time Castillo played in the Mexico league after eight years of playing abroad.
On 10 December 2012, Castillo was loaned to Club León for six months, for whom he made seven appearances in total.
On 9 July 2013, he went to Spanish club Rayo Vallecano on a free transfer from Pachuca.
Castillo was eligible for citizenship in four countries; Uruguay because his father is from there; Italy due to his maternal grandparents; Greece because he resided there for more than six years and Mexico where he was born.
His first experience of international football came when he was called up to a Uruguay U-17 training camp. However, he was released after playing a few friendly games. Next the Greek coach Otto Rehhagel tried to secure his services for the Greece national football team. Greece were reportedly willing to pay Castillo $800,000, including fast-tracked citizenship as part of the offer.
Ultimately, Castillo decided to play for the country of his birth and joined the Mexico national football team.
He made his international debut for Mexico on 2 June 2007 vs Iran, in his hometown San Luis Potosí with Mexico winning the game 4–0, and went on to represent his country in the 2007 CONCACAF Gold Cup, where he scored his first international goal against Cuba, and in the 2007 Copa America.
In the 2007 Copa America, a pre-tournament injury to Jared Borgetti gave Castillo a starting berth, and he scored l in Mexico's first match of the tournament, a 2–0 win against Brazil.
He scored again against Ecuador, as Mexico secured a place in the knockout stages, and scored a brace in the quarter-final against Paraguay, the first goal from the penalty spot. Overall, Castillo was the third highest goal scorer of the tournament with four goals, behind Juan Román Riquelme and Robinho.As of 20 July 2015
Superleague Greece (6): 2000–01, 2001–02, 2002–03, 2004–05, 2005–06, 2006–07
Greek Cup (2): 2004–05, 2005–06
UEFA Cup (1): 2008–09