Commonwealth Court Judge Bernard McGinley said DeWeese may not appear on the November ballot, and the Democratic Party is free to replace him.
"DeWeese's criminal conduct and conviction have rendered him ineligible to hold public office," McGinley wrote. "Also, DeWeese's prison sentence will span the entire term of the elected position and, if in fact he won the general election in November 2012, his felony convictions would bar him from holding office."
The state party sought the ruling so that they can find another candidate to oppose the Republican running in November for the southwestern Pennsylvania seat.
During a teleconference earlier this week, DeWeese's lawyer Courtney Powell told McGinley it was premature to rule because DeWeese is pursuing appeals and might be eligible to serve by the time the ballots are cast.
DeWeese, 62, is serving a 2 1/2- to 5-year sentence at a state prison in northeastern Pennsylvania for using his staff and state resources for campaign purposes. He was convicted of conspiracy, conflict of interest and theft.
During the Wednesday teleconference, the lawyer for the state Democrats and the three people who sued to remove DeWeese argued his five felony convictions barred him from holding public office under the state constitution, and McGinley agreed.
DeWeese resigned the day he was sentenced in April, and that same day voters re-nominated him in an uncontested primary.
DeWeese's lawyer, Courtney Powell, had argued that if DeWeese still isn't eligible to serve come January, when the new legislative session starts, the state can hold a special election to replace him.
The Republican candidate is Mark Fischer of Waynesburg.
Messages left after hours Friday for Powell and for the Democrats' lawyer, Cliff Levine, were not immediately returned.