The information was not public, the judge said. Donaghy had "unique access," including what crews would officiate at games, the interaction of different officials and players, and the physical condition of certain players.
He concealed the scheme from the NBA and other referees to avoid detection, the judge said. Donaghy also must pay a $500,000 fine and at least $30,000 in restitution.
Prosecutors said in open court that Donaghy bet on games himself; but that was not part of his plea.
The FBI first contacted the NBA on June 20 to talk about a referee alleged to be gambling on games, and the two sides met on June 21, NBA commissioner David Stern said last month. Donaghy resigned July 9 after 13 years as a referee; Stern said he would have fired him sooner but was told it might affect the investigation.
Stern blamed a "rogue, isolated criminal" for the betting scandal that threatened the credibility of every referee.
Donaghy was rated in the top tier of officials, Stern said, and there was nothing suspicious about the frequency of his foul calls. He was assigned to work in the second round of the playoffs, with his last NBA game coming during the Phoenix-San Antonio Western Conference semifinal series.
No other NBA officials or players were expected to be involved in the scandal, which Stern called the "most serious situation and worst situation that I have ever experienced either as a fan of the NBA, a lawyer for the NBA or a commissioner of the NBA."