Justice Esther Maina ruled that Rigathi Gachagua, who is presidential candidate William Ruto's running mate, had failed to explain the source of 200 million Kenyan shillings found in his bank account and should therefore surrender it to the state.
Gachagua, who in court papers said the money came from his companies' business dealings, blasted the ruling and vowed to appeal.
"The judge was biased against us from the word go and threw caution to the wind by conducting a sham trial," he said on Twitter.
Both outgoing Deputy President Ruto and his main presidential rival, former prime minister Raila Odinga, have pledged to tackle graft, but voters remain skeptical as corruption infects almost every level of society.
The case highlights the endemic corruption in Kenya, where the anti-graft body last month raised "integrity" concerns about more than 200 candidates standing for various offices in the August 9 polls.
Interior Minister Fred Matiang'i said on Tuesday that banks were running out of 100 and 200 shilling notes because they were being used by politicians to bribe people ahead of the vote.
He accused the politicians of "laundering themselves" into elected institutions and voiced fears that those voted into office may not act to clean up the system.
Kenya was ranked 128th out of 180 countries on Transparency International's 2021 graft perceptions index, with the watchdog saying its fight against corruption had "stagnated".