The post comes amid protests against a “zero tolerance” policy introduced by Donald Trump’s administration which stated any adult who entered the country illegally would be prosecuted and split up from their children.
Because the children are not charged with a crime, US rules say they cannot be detained with their parents.
In a Twitter video, called How Becoming A Father Changed My Life, Mr Ryan said having children had altered his ambitions during his career.
In the caption, he wrote that his “life changed the day I became a father”.
“Liza, Charlie and Sam are my highest priority. Wishing all of the dads out there a happy early #FathersDay.”
Legend tweeted: “Seriously, f*** you. Reunite the families at the border and we can talk about father’s day.”
Mr Ryan has vowed to spend more time with his wife and children and said this was why he was not seeking re-election.
The immigration policy announced in May has resulted in several hundred children being split up from their parents at the US-Mexico border.
Mr Trump has defended the policy, saying the Democrats were “forcing the breakup of families at the Border with their horrible and cruel legislative agenda”.
On Saturday he tweeted: “Democrats can fix their forced family breakup at the Border by working with republicans on new legislation, for a change!”
Legend and his wife, model Chrissy Teigen, have been fierce critics of Mr Trump and she recently used Twitter to criticise the immigration policy, saying she and members of her family were donating cash to the American civil liberties union and urged others to contribute.
She wrote: “John and I are outraged to see and hear the horror stories of immigrant families seeking asylum and refuge in America being ripped apart due to the inhumane policies of the Trump administration.
“These actions are cruel, anti-family and go against everything we believe this country should represent.”