Villa's 14th goal of the season helped NYCFC (16-10-8, 58 points) secure home field in a knockout-round game on Wednesday or Thursday in a rematch against the Union. NYCFC finished the regular season with a 12-1-4 record at home.
Philadelphia (15-14-5, 50 points) entered level on points with D.C. United, but in fourth place because of an edge in the tiebreaker. Instead, the Union fell a point behind D.C. United and the Columbus Crew and finished in sixth.
Villa's goal capped a spectacular sequence for NYCFC. His right-footed shot from the center of the box was stopped by Philadelphia goalkeeper Andre Blake, but the defense failed to clear it.
Instead, the ball caromed to Villa, who converted the rebound into a right-footed shot that sailed into the center of the net.
New York never trailed, taking a 2-0 lead in the first 10 minutes.
Maxime Chanot scored on a header off a corner kick in the eighth minute and NYCFC caught a break when Philadelphia's Auston Trusty's clearing attempt wound up in the back of the Union goal.
It was the second time this season NYCFC scored when an opposing player fired into his own net.
Philadelphia scored in the 14th minute when Cory Burke fired a left-footed shot by Sean Johnson.
Johnson finished with four saves while Blake stopped five shots.
NYCFC 3-1 Philadelphia: Pigeons win with ease
NYCFC gained control early and never looked back, as the Pigeons secured three points at home on Decision Day.