The Massachusetts Democrat also said the alleged White House leak of a CIA agent's identity was more serious than the media's disclosure of the spying program.
Bush said Monday it was "a shameful act" for someone to have leaked details of the spying program that he authorized shortly after the attacks of Sept. 11, 2001.
The program allows the National Security Agency to eavesdrop — without warrants — on international calls and e-mails of Americans and others inside the U.S. with suspected ties to Al Qaeda.
Kerry, talking with reporters after addressing ironworkers at a local labor hall, contrasted the media's disclosure of the spy program with the White House leak involving Valerie Plame.
Her identity as a CIA analyst was exposed in July 2003 after her husband, former ambassador Joe Wilson, challenged an administration justification for the Iraq war.
"The leak in the White House was an effort to destroy somebody and his family and attack them for telling the truth," the senator said.
"The leak that took place in this case is a leak that — I'm not excusing it — is to tell the truth about something that violates the rights of Americans and doesn't uphold our Constitution," Kerry said.
Bush has said Congress gave him the power to authorize the spying under a mandate to protect the country "by all means necessary."
Kerry called the explanation "lame" and said "there is no wording whatsoever in the law that permits what he engaged in."
The Republican National Committee batted away the criticism.
"While President Bush remains focused on defending Americans against those intent on doing us harm, John Kerry remains focused on attacking President Bush," RNC spokeswoman Tracey Schmitt said.