Prince Charles has praised the "wonderful work" undertaken by religious communities during the coronavirus pandemic.