Administration officials and Democratic lawmakers said Sunday the off-the-cuff remark was an emotional response to the president’s interactions in Warsaw with refugees—some of whom had fled violence in Mariupol, a Ukrainian southern port city under weekslong Russian bombardment and attacks on civilians.