A man was arrested after the fires at Wasserstein and police suspect arson. No-one in the hostels was badly hurt.
More than a million refugees and migrants have arrived in Germany this year, and for most their first stop has been in Bavaria.
President Joachim Gauck devoted his Christmas message to the recent influx.
"We have shown what we are capable of, in terms of good will and professionalism, but also in the art of improvisation," he said, praising fellow Germans for their response to the crisis.
But he also called for the full force of the law to be used against anyone using violence against the new arrivals.
"Arson and attacks on defenceless people deserve our contempt and deserve punishment," the president said.
Refugee hostels in Germany have come under more than 200 attacks this year alone, according to research by Die Zeit newspaper, but the authorities have secured convictions against only a handful of attackers.
Migrant crisis explained in maps and graphics
Germany's 'historic test' - Merkel
Reports of Merkel's demise are greatly exaggerated
Year of the migrant - a crisis unlike all others
Chancellor Angela Merkel promised last week that Germany would "noticeably reduce the number of refugees" in response to criticism from within her centre-right CDU party.
Up to 40% of arrivals in Germany have come from Balkan countries such as Albania and Kosovo which are considered safe. Most of the other arrivals are refugees from Syria, Iraq and Afghanistan.
European countries have struggled to cope with the large number of people reaching the shores of the EU. This week, international migration officials said more than a million "irregular" migrants and refugees had come by land and sea, the vast majority via Greece.
Czech Prime Minister Bohuslav Sobotka singled out Mrs Merkel for blame for sending out a signal across the Middle East and Africa which "stimulated illegal migration to Europe".
UN refugee officials say 3,716 people died or went missing this year as they tried to cross into Europe.
But there was good news for one Afghan family who feared their 10-year-son had drowned off the Turkish coast.
The Rabani family, who have since arrived in the German state of Lower Saxony, became separated from their son as they boarded a boat in Turkey. His boat capsized and many of those on board drowned.
A German Red Cross official eventually succeeded in tracking down the child, who was found staying at a refugee hostel in Switzerland. The family hope to be reunited in a few weeks' time.
In a separate development, a young Palestinian refugee who made headlines in July when she cried in front of Mrs Merkel has reportedly been told by German immigration officials that she and her family will be able to stay in the country until 2017.
Reem Sahwil, 14, had told the chancellor on live TV that she wanted to go to university but she burst into tears when the chancellor explained that not all migrants could stay in Germany and that politics "can be tough".
Mrs Merkel tried to comfort the girl by stroking her head.

"Powerful women needed," ads published in national newspapers say alongside the face of a woman obscured in shadow.
Mossad already has a staff that is 40% female, with 24% of them in key senior roles, local media report.
Women have been praised as better secret agents by a former Mossad chief.
Tamir Pardo said in 2012 that female agents "have a distinct advantage in secret warfare because of their ability to multitask" and they "suppress their ego in order to attain goals," according to the Jerusalem Post.
"Contrary to stereotypes, you see that women's abilities are superior to men in terms of understanding the territory, reading situations, spatial awareness. When they're good, they're very good," the then-agency chief said.
The Mossad website tells would-be female recruits: "It's not what you've done, it's who you are."
Have you got what it takes to be a spy?
Listen to BBC Radio 4 documentary 'The Mossad' (2010)
Twelve people were hurt, including seven teenagers, when fires broke out at two neighbouring refugee hostels in the south German region of Bavaria.
[NEXT_CONCEPT]
Israel's shadowy international spy agency, Mossad, is seeking to bolster its ranks with more women, launching its first recruitment drive specifically targeting females.