The drive to pass a workable law providing for public financing of political campaigns in Maryland picked up speed yesterday when the state Senate pased a bill that would allow candidates for the top four statewide offices to run on money from the state treasury.

The measure, which now goes to the House of Delegates for consideration, is designed to repair the badly flawed public financing law passed in 1974 by an election-year General Assembly eager to show voters in this scandal-torn state it was serious about reform.

That law provides for public financing of campaigns of almost all state and local officials and is funded by the voluntary contributions of Maryland taxpayers who are willing to add an extra $2 to their income tax payments.

The financing mechanism has only raised $400,000 far short of the millions of dollars needed for a statwide campaign. In a past three years, reformers have failed to persuade old-guard legislators to pass a workable law.

The bill passed by the Senate by a margin of 32 to 12 would restrict public financing to the state's top four elected offices - governor, lieutenant governor, attorney general and comptroller.

The money to finance their races would come from the state's general treasury instead of special voluntary contributions. If the bill passes the House, which is generally unrecpetive to such measures, the program would cost taxpayers about $1 million a year.