Castro was signed by the Padres as a free agent from the Dominican Republic in 2006. He was considered quite raw when signed, but the Padres liked his arm strength and projectability. After a poor pro debut in the Arizona Rookie League in '07, he was one of the better pitchers in the Northwest League in 2008, then broke out with a strong campaign in the Midwest League in '09. Named by Baseball America the top pitching prospect and 2nd overall prospect in the Padres organization prior to the 2010 season, he spent most of the season with the San Antonio Missions of the Texas League before being promoted to Triple-A for his final 2 starts of the season. Following the 2010 season in which he went a combined 7-7 with a 3.28 ERA across 2 minor league stops, Castro was added to the Padres' 40 man roster to protect him from the Rule 5 draft
Chicago White Sox
After struggling most of the 2011 season, on December 31, 2011, Castro, along with Pedro Hernández, were traded to the Chicago White Sox for outfielder Carlos Quentin. On July 5, 2013, Castro made his Major League debut against the Tampa Bay Rays. He pitched three scoreless innings, giving up two hits, walked two and struck out four. Castro was outrighted off the White Sox roster on November 1, 2013.
Colorado Rockies
On April 25, 2014, Castro signed with the Colorado Rockies on a minor league deal.
Oakland Athletics
On December 1, 2016, Castro signed a minor league contract with the Oakland Athletics that included an invitation to spring training. He was assigned to the Triple-A Nashville Sounds to begin the 2017 season. Castro pitched the ninth inning of a combined no-hitter against the Omaha Storm Chasers on June 7, 2017. Starter Chris Smith pitched the first six innings and was then followed by Sean Doolittle, Tucker Healy, and Castro who each pitched one inning. He was outrighted to Triple-A on November 5, 2017, and then elected to become a free agent. He later signed a minor league contract with the A's for 2018. He made 6 relief appearances with Triple-A Nashville, amassing a 7.56 ERA, before being released on May 3.