Atletico keeps pace with Barcelona
Costa converted from the spot seven minutes before half-time after Diego Mainz had clattered into the back of Villa.
The former Barcelona striker also won the second penalty and this time took the spot-kick himself, sending Granada goalkeeper Roberto the wrong way.
The hosts were allowed back into the game when Atleti full-back Filipe Luis was sent off in the closing minutes, and Odion Ighalo got a goal back in the first minute of injury time to set up a tense finish for Los Rojiblancos, but in the end they held on.
Both sides went into the game after confidence-boosting wins. Atletico had battered Real Betis 5-0, while Granada earned a vital away win at Elche.
The game produced few clear cut chances, but it was the hosts who were the first side to frighten their opponents, Recio striking the outside of the near post from inside the area.
After Allan Nyom had laid the ball off to him Costa - who this week officially confirmed he will represent Spain in international competitions and not his native Brazil - had Atleti's first chance of the game, heading a cross from Juanfran into the arms of Roberto.
With nine minutes remaining of the first half, Atleti were awarded a penalty. Mainz rose to contest a header with Villa and ended up pushing him in the back and to the ground.
Costa made no mistake from the spot and scored his 12th goal of the season to reaffirm his place at the top of the league's goalscoring charts.
Moments before the break, Adrian should have doubled the lead. The forward, in the starting line-up due to the continued absence of Arda Turan, controlled the ball just ahead of the six-yard box and just had Roberto to beat, but smashed the ball a few inches wide of the near post.
The second period saw even fewer openings than the first, and it was not until 68 minutes that a clear chance emerged. Granada midfield Manuel Iturra - one of Lucas Alcaraz's best performers on the night - was dispossessed in midfield and Atleti broke quickly, Villa releasing Costa, but Roberto came rushing out of his goal and blocked the shot with his arm.
With 13 minutes left, Atleti got their second penalty.
Villa entered the box from the right side and turned Colombian defender Jeison Murillo, who stuck out a leg to bring down the Spaniard.
The 31-year-old was allowed to take the penalty this time, even though Costa was still on the pitch, and calmly doubled the lead.
Substitute Raul Garcia could have added a third in the last minute but was denied at point-blank range by Roberto, but Luis then handled the loose ball, and was given his second yellow card of the night.
Granada quickly made the extra man account, as Ighalo headed in a deep cross from Nyom past a stranded Thibaut Courtois.
Atleti looked in a panic and breathed a sigh of relief when Granada's last attempt, a shot from outside the area from Nyom, went wide.
The Associated Press contributed to this report.