Democratic U.S. Sen. John Glenn of Ohio came to Maryland tonight to make headlines for his 1984 presidential effort, but for the state Democratic Party, which staged its annual dinner in his honor, it was a night to make money: an estimated $40,000.

The Democrats, who control every major political post in Maryland except one of the state's eight congressional seats, have had serious financial troubles.

Just six months ago the party, whose titular head is Gov. Harry Hughes, was operating in the red. The party was having a hard time competing for fund-raising dollars with a host of state candidates, including Hughes, U.S. Sen. Paul S. Sarbanes, and Attorney General Stephen H. Sachs. In fact, a scheduled party fund-raiser last fall had to be canceled because other candidates had scheduled their own events.

Privately, many Democratic stalwarts blame Hughes, a decidedly apolitical governor, for failing to lead the party into fiscal health. Some have criticized Hughes for waiting to get involved in tonight's event until he had held a lavish fund-raiser of his own last month. Hughes only began to push potential fund-raisers to attend tonight's function after weeks of prodding by the state party chairman, State Sen. Rosalie Abrams.

Tonight, with the former astronaut as a star attraction, the Democrats were hoping to build up their political kitty.

Party officials estimated that several hundred Democrats attended a $100-a-person cocktail party tonight and about 1,400 sat through a $35-a-head dinner at the Martin's West catering hall, complete with speeches by Sarbanes, Lt. Gov. J. Joseph Curran Jr. and Glenn. These festivities also attracted Sachs, Rep. Michael D. Barnes of Montgomery County, Rep. Steny Hoyer of Prince George's County and Baltimore Mayor William Donald Shaefer. Hughes could not attend because he was home with flu.

Glenn, in his second visit to Maryland in six months, attacked the Reagan administration's policies on the economy and civil rights.

And, in an effort to demonstrate his familiarity with Maryland, Glenn noted that he had lived in Montgomery County for the last nine years and mentioned all the major Democratic politicians in the state and several important local issues.