Former world number one Sharapova returned to action in April but was denied a wildcard for the French Open.
The 30-year-old Russian, a five-time major winner, was given one for Wimbledon qualifying but withdrew with an injury.
Sharapova has volunteered to speak to young tennis players at the USTA National Campus about the importance of the tennis anti-doping program
The US Open will take place at Flushing Meadows from 28 August to 10 September.
"Her suspension under the terms of the tennis anti-doping program was completed and therefore was not one of the factors weighed in our wildcard selection process," The United States Tennis Association (USTA), which oversees the US Open, told BBC Sport.
"Consistent with past practice, a wildcard was provided to a past US champion who needed the wildcard for entry into the main draw.
"Previous US Open champions who have received US Open main draw wildcards include Martina Hingis, Lleyton Hewitt, Kim Cljisters and Juan Martin del Potro.
"Additionally, Sharapova has volunteered to speak to young tennis players at the USTA National Campus about the importance of the tennis anti-doping program and the personal responsibility each player has to comply with the program's requirements."
Sharapova returned to playing without a ranking in April and rose to 211 in the world after receiving wildcards in Stuttgart, Madrid and Rome.
She hoped to receive a wildcard for the French Open, but was denied one for both the main draw and qualifying rounds.
The 2006 US Open champion then elected to try to reach the Wimbledon main draw through qualifying, however she pulled out of the tournament having failed to recover from the muscle injury she sustained at the Italian Open the previous month.
She is currently suffering from a left forearm injury which forced her to pull out of this week's Cincinnati Open. She withdrew from the Stanford Bank of the West Classic earlier this month after suffering the injury in her first-round match.
In June 2016, Sharapova was punished with a two-year doping ban for testing positive for heart disease drug meldonium at the 2016 Australian Open.
It was reduced to 15 months following her appeal to the Court of Arbitration for Sport.
Maria Sharapova is set to play in her first Grand Slam since her 15-month drugs ban after being given a wildcard for the US Open main draw.