The Finance Minister said he would not "walk by on the other side" as tenants struggled to cope with the cuts to housing benefit by the UK government.
But he was accused by Labour, the STUC and charities of doing too little to help.
The £20m will allow councils to provide more discretionary pay-ments to social housing tenants but is less than half the estimated £50m required to cancel out the impact of the bedroom tax for all 80,000 people affected.
The money - announced on the day a United Nations envoy declared the bedroom tax a breach of human rights - will only be available this financial year.
The row came as Mr Swinney unveiled his budget for 2014/15, the last before the referendum, and outlined indicative spending plans for 2015/16.
Vowing to protect universal entitlements, relax public sector pay caps and increase spending on colleges and house building, he insisted his budget "makes clear the benefits of decisions being made in Scotland".
The £20m to offset the impact of the bedroom tax amounted to just 0.007% of the Scottish Government's £30billion budget but the row it sparked overshadowed other announcements.
Addressing MSPs, Mr Swinney denounced the "iniquitous effect of the bedroom tax" but pressed on why he had no plans to help tenants after April he replied: "I have no intention of letting the Westminster Government off the hook."
He said later he wanted to "maximise pressure" on the UK Government to reverse the cuts and insisted the sum was as much as he could allocate legally under Department of Work and Pensions housing grant rules.
But Scottish Labour finance spokesman Iain Gray said: "We now know the poorest, most vulnerable, disadvantaged Scots will be left on John Swinney's hook just so he can make a political point. This is a victory for those who have called for the Scottish Government to act on the bedroom tax now but it doesn't go far enough."
Margaret Lynch, chief executive of Citizens Advice Scotland, said the cash should not be seen as "exceptional or a one-off".
She added: "The scale of the welfare crisis is huge, and even more support is needed."
Graeme Brown, director of housing charity Shelter, welcomed the £20m but admitted: "It still won't help everyone affected by the bedroom tax."
STUC general secretary Grahame Smith, meanwhile, called on the Scottish Government to outlaw bedroom tax evictions, a Labour proposal rejected by Deputy First Minister Nicola Sturgeon during a TV debate last week.
Mr Swinney's total budget for the coming financial year is £35.4bn. Stripping out pensions and other fixed costs, he announced spending of £26.6bn to maintain services and £2.9bn on infrastructure projects.
Despite, he said, being "constrained by significant cuts" he found extra cash for affordable housing and promised to secure investment of £8bn on building projects over the next two years.
College budgets will be maintained at £522million next year, rising slightly to £526m in 2015/16.
In the year Glasgow will host the Commonwealth Games the Mr Swinney also announced £24m for a National Performance Centre for Sport and a further £20m to boost cycling as a form of "active transport".
On public sector pay he relaxed wage limits to give the lowest earners a £300 rise next year. He also ended the wage freeze for civil servants and quango chiefs earning more than £80,000, allowing them a 1%rise. In another move designed to avert potential unrest in the run-up to the referendum, he ruled out following the UK Government in scrapping "pay progression," or automatic salary rises based on experience.
The Scottish Conservatives claimed the budget relied on a big increase in business rates to balance the books and would do nothing to boost the economy. Finance spokesman Gavin Brown added: "This was a budget from a zombie Government which now has both eyes fixed firmly on the referendum."
Greens leader Patrick Harvie said the plans were "lacking in ambition".