John Wilson, chairman of the City Council's Finance and Revenue Committee, could be forgiven if he gloats a little these days.

Early last year, Wilson warned that the D.C. government was in far worse financial shape than the rosy election-year assessment then being offered by Mayor Marion Barry. "The mayor must be the only fool in the country because nobody else thinks things are looking up," Wilson said at the time.

Now, less than two months into Barry's second term, many of Wilson's warnings seem prophetic: The mayor is struggling to avert a potential $110 million deficit this year. There may not be enough revenues to balance his 1984 budget proposal. The latest audit shows that the city's overall debt continues to pile up.

Yet Wilson seems to take little satisfaction in his apparent vindication. Until recently, at least, he has seemed glum and distraught, a brooding figure puzzled by the fact that being right isn't always perceived as a virtue in politics.

"I'm totally depressed right now," Wilson said recently. "The problem is we've taken a serious kicking because we tried to do what we thought was right."

Wilson, 39, a one-time civil rights and anti-Vietnam war activist, is a thoughtful and zesty politician with a strong staff. He is best known for his brutally frank political comments, which sometimes give the appearance of shooting from the hip.

In late 1981, for instance, after the council reversed itself and voted to kill a bill to discourage real estate speculation, Wilson publicly accused some members of having sold their votes to real estate investors and home builders.

During three terms on the council, Wilson built a solid political base in the racially and economically mixed near-downtown Ward 2 but may have limited his prospects for higher office by backing highly controversial measures.

Wilson believes he alienated potential campaign donors in the real estate industry by opposing abolishment or dilution of the city's rent control laws and by helping to rewrite the condominium conversion law to benefit tenants who want to buy their apartments.

Wilson also angered politically potent black business owners by proposing a change in the District's minority contracting law that enables Asian-Americans to share in city contracts. Some black businessmen strongly opposed that change, saying it could reduce benefits for blacks.

Wilson was personally hurt when several longtime friends who worked with him in the Student Non-Violent Coordinating Committee, including Deputy Mayor Ivanhoe Donaldson and Courtland V. Cox, another city official, stopped calling him after he accused Barry, an SNCC alumnus, of misleading the public about the severity of the city's financial problems.

But Wilson's biggest disappointment was his short-lived campaign to unseat Barry in the 1982 Democratic primary.

He was convinced he could win widespread support by taking to the people his case that Barry had mishandled the city's budget and was following a crisis-oriented approach to government.

But he quit the race two months after he began it, dejected and convinced that a lack of support from major campaign donors, unfavorable press converage and his own controversial style and voting record kept him from getting his campaign off the ground.

"The fact that I have the strongest legislative record of any of those running for mayor has proven to be a hindrance rather than a help," Wilson said then.

Wilson, a pragmatist, later threw his support to Barry.

For a long time afterwards, he was in a deep funk about his political fortunes, fretting that he had become a prophet without honor in his own city.

More recently, however, he has begun to snap out of it and once again has begun poking holes in Barry's financial pronouncements.

Two weeks ago, Wilson reveled in the release of the city's fiscal 1982 audit, a report he said confirmed his contention that the city debt was continuing to rise, primarily because of deficit spending in the water and sewer fund.

Tomorrow, Wilson will move to the center of another budget debate when his Finance and Revenue Committee decides whether to go along with the $14.4 million tax package that Barry says is essential to balance the 1984 budget.

Wlson, ever the prophet, has predicted that his committee will reject the package. Although not all his predictions have been flawless, this one has got the Barry administration worried.