Spanier, 70, had argued the trial judge and a lower appeals court wrongly relied on a statute of limitations law that prosecutors never cited.
He has been out on bail and has not begun serving a sentence of two months in jail and two months' house arrest.
Spanier's lawyer, Sam Silver, said they were disappointed by the court's decision, while prosecutors said they were pleased.
"No one is above the law, and my office will continue to pursue anyone who looks the other way in the face of child sexual abuse," Attorney General Josh Shapiro said in a statement. "There are consequences for failing to protect children in Pennsylvania."
Spanier's lawyers have said that for the relevant provision of the state's statute of limitations to apply, prosecutors would have needed to prove the boy in the shower in 2001 was less than 14 years and 11 days old. Referred to as "Victim 2" in court records and testimony, the boy's identity has been disputed, with prosecutors saying they are not sure who he is.
At the lower-level Superior Court, two of three judges on the appeals panel turned down Spanier's arguments that too much time had passed to charge him, that he was not legally obligated to care for the boy, and that he should not have been charged because he did not supervise children directly.
But the third Superior Court judge said Spanier should have been told at a reasonable time before trial that prosecutors planned to rely on an exception to the two-year statute of limitations. She said she would have reversed his conviction.
Two of Spanier's top aides when he was Penn State's president, former vice president Gary Schultz and former athletic director Tim Curley, pleaded guilty to child endangerment and testified against him in 2017. They have since served county jail sentences.
Spanier, who did not take the stand at trial in his own defense, has said Sandusky's attack on the boy was characterized to him as horseplay.
He told the sentencing judge he regretted he "did not intervene more forcefully."
Spanier was forced out as Penn State's president within days of the November 2011 arrests of Sandusky, Curley and Schultz. He was himself charged criminally a year later.
Penn State said Thursday Spanier remains a tenured faculty member and is on paid administrative leave. The school does not release his salary.
Sandusky is serving 30 to 60 years on a 45-count child sexual abuse conviction. He maintains he was wrongly convicted and recently won a Superior Court decision that granted him a new sentencing but did not give him the new trial he sought.
The scandal has cost the university more than a quarter-billion dollars, including payments to those who said Sandusky abused them as boys.