Kelley wound up and flung his glove to the ground.
"I thought that the act that he portrayed on the field last night was disrespectful to the name on the front of the jersey, the organization, specifically [manager] Davey Martinez," general manager Mike Rizzo said Wednesday. "You're either in or you're in the way, and I thought he was in the way.
"That's something that you don't come back from. It was a disrespectful act, and I thought it warranted him leaving the team. I didn't see how he could face the rest of his teammates and the coaching staff and the manager again after such a selfish act."
Added Martinez: "It stinks. It really does. I've got a lot respect for Shawn, I do. But that wasn't right. We just won a game 25-4."
Kelley apologized after the game for his actions.
"You should never throw your glove," he said. "We should act like adults."
Rizzo said Kelley, who had allowed a home run in two of his past four appearances and has a 3.34 ERA in 35 games this season, appeared to glare at Martinez in the dugout.
"It may not have been [directed at Martinez], but that's the way I looked at it," Rizzo said. "... [After the trade deadline] I thought I was truly a day that we should've been happy and celebrating. We had a big win against a division rival, and we felt good about ourselves, and it was such a selfish act. Really is not what we're here for.
"... He's a veteran player. He's a professional, and it was something that I didn't expect. But it was something I couldn't ignore. ... We're not going to let any one person derail what we're looking to do."
Martinez, who said he wasn't going to disrespect the Mets by having a position player enter the game to pitch, said he never thought Kelley was showing him up.
"I know he was frustrated. For whatever reason, he was frustrated," Martinez said. "... Knowing what we did yesterday, scoring all those runs, everybody's feeling good. He comes in the game, slams his glove, frustrated. That bothered me. A lot.
"It was disrespectful to his teammates and the organization. ... I wish him all the best. He's a guy that I got to know personally. He's not a bad person. He's not."
The Nationals selected the contract of right-handed pitcher Jimmy Cordero in a corresponding move. Cordero is joining the majors for the first time. He has a 1.67 ERA in 38 appearances for Triple-A Syracuse in 2018.
The Associated Press contributed to this report.