A federal judge ruled yesterday that a three-year-old Maryland law barring payments to persons collecting signatures to petition issues onto election ballots violates First Amendment rights to freedom of speech.

The decision by Judge Norman P. Ramsey in Baltimore came in a suit brought by Montgomery County lawyer Robin Ficker, a political gadfly who is known for masterminding petition drives on controversial issues. Ficker, who had paid for signatures during the 1984 campaign to place an issue on the ballot changing the way the County Council is elected, had been warned by a state official that he could be prosecuted if he paid for such collections again.

He is now clear to begin a new petition drive aimed at the 1986 ballot.

"I've got a couple of ideas for '86, but I'm not going to announce them at this time," the former state delegate said yesterday.

Ficker, who has placed issues on the ballot in each of the last six elections, filed the suit earlier this year after he said he was threatened with prosecution for violating the law during the 1984 election.

The Washington branch of the American Civil Liberties Union agreed to represent him, and Arthur Spitzer, ACLU legal director, praised the ruling yesterday.

"It's a significant case because putting initiatives on the ballot is an important part of the political process," he said. "If you can't pay people to circulate a petition your ability is severly limited.

"As a legal matter, the courts have recognized that this is no different than buying an ad in The Washington Post or on the television," he said.

Diana G. Motz, chief of litigation in the Maryland attorney general's office, said there have been three or four similar cases around the country and courts have generally struck down those statutes as well.

Motz, who defended the law on behalf of the state, said the judge, in reaching his decision, relied on a 1978 U.S. Supreme Court case known as Buckley v. Valeo. Judge Ramsey generally held that spending personal funds on political campaigns was protected by the First Amendment, she said.

In a sworn affidavit, Ficker acknowledged paying workers to collect petition signatures as far back as the 1974 election.

The law in question was passed by the Maryland General Assembly in 1982 and made the practice illegal starting with the 1984 election.

Last year, however, Ficker said he paid workers from five to 25 cents a signature for circulating petitions and spent a total of $2,600 to place an initiative on the ballot requiring County Council elections by district rather than at-large voting. The initiative was defeated.

Then, in March, he said Assistant State Prosecutor Bernard Penner warned him that he would be prosecuted if he paid workers to collect signatures again, according to the affidavit.

Without the ability to hire people for the petition drives it would have been difficult if not impossible to put issues on the ballot, Ficker said.

Under state law, any citizen can place a question on a local election ballot by collecting the signatures of registered voters in his jurisdiction.