On November 20, 2020, the Pirates added Castro to their 40-man roster to protect him from the Rule 5 draft.[5] He was promoted to the major leagues for the first time on April 21, 2021. He made his MLB debut that day as the starting third baseman in the second game of a doubleheader against the Detroit Tigers.[6] He was optioned to the Altoona Curve in mid-July, but was recalled shortly after the Pirates traded Adam Frazier, with Castro being Frazier's replacement at second base.[7] On July 28, Castro hit two home runs against the Milwaukee Brewers. These were both his fourth and fifth major league home runs and his fourth and fifth major league hits, making him the first major league player since at least 1901 whose first five major league hits were all home runs.[8] In 31 games during his rookie campaign, he batted .198/.258/.395 with 5 homers and 8 RBI.
In 2022, Castro played in 71 games for Pittsburgh, hitting .233/.299/.427 with 11 home runs and 27 RBI.[9] He began the 2023 season with the Pirates, slashing .228/.317/.355 with 6 home runs and 22 RBI.[10]
On August 9th, 2022, Castro was playing a game when he slid into third base, which would force a cellphone to slide out of his pocket. He was suspended for one game and assessed a fine for having his phone in his pocket during a game.[11]
Philadelphia Phillies
On August 1, 2023, the Pirates traded Castro to the Philadelphia Phillies for pitcher Bailey Falter.[10][12] In 14 games for the Phillies, he batted .100/.156/.100 with no home runs and two RBI.
Castro was optioned to the Triple-A Lehigh Valley IronPigs to begin the 2024 season.[13] In 19 games split between Lehigh, the High-A Jersey Shore BlueClaws, Single-A Clearwater Threshers, and rookie-level Florida Complex League Phillies, he slashed a cumulative .221/.286/.351 with three home runs and nine RBI. On August 22, 2024, Castro was diagnosed with a torn ligament in his right thumb and was ruled out for the remainder of the season.[14] On November 4, Castro was removed from the 40-man roster and sent outright to Lehigh Valley. Two days later, he elected free agency.[15]
On November 21, 2024, Castro re-signed with the Phillies on a minor league contract.[16] He made 133 appearances for Triple-A Lehigh Valley in 2025, batting .235/.324/.421 with 19 home runs, 82 RBI, and 18 stolen bases. Castro elected free agency following the season on November 6, 2025.[17]
Toronto Blue Jays
On November 25, 2025, Castro signed a minor league contract with the Toronto Blue Jays.[18] He was released by the Blue Jays organization on January 9, 2026.[19]