The Spain striker swept the ball past Getafe goalkeeper Jordi Codina in the 39th minute to draw level on 16 goals with Barcelona forward Lionel Messi.
Villa's international colleague David Silva then sent him clear on the left seven minutes after the break and he lifted a delightful lob over the advancing Codina for his 17th of the campaign.
Valencia defender Alexis Ruano was shown a second yellow card in the 61st before Manu del Moral pulled one back for the visitors with 15 minutes of regular time remaining.
The victory lifts Unai Emery's side to 46 points from 23 matches, 10 behind second-placed Real Madrid, who trounced Villarreal 6-2 at the Bernabeu on Sunday.
Real trail leaders Barcelona by two points after the champions beat visiting Racing Santander 4-0 on Saturday. Getafe remain in eighth on 32.
Barcelona knocked out of King's Cup by Sevilla
King's Cup: Sevilla and Getafe take control
Valencia thrash Villarreal to close in on Real
Rampant Real slam six past struggling Zaragoza
Ronaldo inspires Real to 6-2 victory