The Spain striker, who netted in the Copa del Rey win over Lleida on Wednesday, struck his side's second goal after Angel Correa's opener before picking up a second yellow card for his subsequent celebration.
Costa's dismissal was one of the flashpoints of an ill-tempered clash in the capital, in which eight other players were booked and referee Jose Luis Munuera Montero was forced to speak with the Atletico coaching staff shortly before a half-time tussle between the players.
Head coach Diego Simeone started Costa, who had recovered from a knock picked up at Lleida, alongside Antoine Griezmann but it was Correa who broke the deadlock with a clever finish in the first half.
Costa was involved in an argument with Juan Cala as he left the pitch at the interval and he was booked for raising an arm to Djene Dakonam just six minutes before his goal and ensuing red card.
Atleti were fairly untroubled in the closing stages despite their man disadvantage, though, meaning they move to within six points of leaders Barcelona in the table, having played a game more.
Getafe had failed to score in their previous nine league meetings with Simeone's Atletico, but their bright start saw Jan Oblak forced into two saves from Amath Ndiaye in the opening 10 minutes.
Atletico pressure began to build, though, and Correa made no mistake with their first clear-cut opportunity in the 18th minute, placing a crisp shot into the bottom-left corner with the outside of his foot after a fine run and pass from Griezmann.
The half descended into an ill-tempered affair, with the referee's refusal to book Djene for two fouls from behind leading to angry confrontations with Costa and the Atletico coaching staff, before Griezmann was booked for an innocuous challenge to further incense the home players.
Cala and Stefan Savic were both booked for their part in the ensuing argument and the Getafe defender was involved in a further heated exchange with Costa on the touchline, prompting Oblak to lead the striker down the tunnel.
7 - There have been seven yellow cards shown in the first half of Atletico vs Getafe, the most in a first half of a La Liga game this season. Battle.— OptaJose (@OptaJose) January 6, 2018
Costa had been rather subdued on the pitch but he missed a great chance to double the lead just before the hour mark, shouldering Damian Suarez off the ball to get free in the area, only to send a half-volley sailing over the crossbar.
The 29-year-old then became the latest Atleti player to be booked for catching Djene with a raised arm as tempers threatened to flare again, before his match came to a premature end in quite remarkable fashion.
Sime Vrsaljko surged down the right and sent a low cross towards the far post, where Costa arrived to send a composed first-time finish past Arsenal loanee Emiliano Martinez.
The striker celebrated by hurdling the advertising boards and celebrating with the fans right in front of the first row of seats, a decision that earned him a second yellow card and saw him stride off the pitch in bemused fashion.
Griezmann threatened a third with a late free-kick as Atleti saw out the closing stages with little difficulty, though, to ensure their winning start to 2018 continued despite Costa's rather mixed homecoming.
Key Opta stats:
- Diego Costa scored and was sent off in the same LaLiga game for the first time ever.
- Angel Correa has equalled Antoine Griezmann as Atletico's top-scorer in La Liga this season (five apiece).
- Diego Costa has scored with both of his two shots on target since his Atletico return, one vs Lleida in the Copa del Rey and one on Saturday.
- There were seven yellow cards shown in the first half, the most in a first half of a LaLiga game this season.
- Diego Costa has scored five goals in his seven LaLiga games against Getafe, four of them with Atletico.
- Atletico are the first team to have kept 10 clean sheets in a row against a single opponent in LaLiga history.
- Jan Oblak has saved 19 of the last 21 shots on target he has faced in LaLiga, including the five against Getafe.