The party leader was photographed with a special edition of the paper being distributed free to mark the start of the England football team's World Cup campaign.
"Ed Miliband was promoting England's bid to win the World Cup and is proud to do so," a spokesman said.
"But he understands the anger that is felt towards The Sun over Hillsborough by many people and he is sorry to those who feel offended."
The statement came after Liverpool Walton MP Steve Rotheram and city mayor Joe Anderson accused Mr Miliband of failing to take account of continuing fury over the tabloid's coverage of the 1989 disaster, in which 96 people died.
Fresh inquests into the deaths are continuing, and Mr Anderson said: "Support for that publication at any time would be wrong but at such a sensitive time is deeply shocking.
"My city was offended and insulted by the lies and smears peddled by The S*n and their hindrance to our fight for justice is something that will never be forgotten.
"For the leader of the Labour Party to make such an offensive gesture insults not only me but every person in the city.
"This is just another example of how out of touch the politicians in their ivory towers are from the lives of ordinary people.
Mr Rotheram, who raised concerns with Mr Miliband face-to-face after the picture emerged, posted on Twitter: "He never meant any offence, but in my opinion it shouldn't have happened in the first place."