Dawn McKenzie, 34, was stabbed by the 13-year-old in her home in Hamilton in 2011.
The inquiry into her death heard the boy had watched footage of his older siblings brandishing knives before he went to stay with the McKenzie family.
The same video showed them drinking alcohol with a gang's logo behind them.
Social worker Stephen Lorimer, giving evidence at the inquiry, said that the boy had been in a stable, happy placement with the foster couple who were caring for him.
But the couple handed in their notice after a member of their own family became very ill, and the boy was moved to stay with Mr and Mrs McKenzie instead.
Mr Lorimer, who is now a team leader within Glasgow City Council's social work department, told the inquiry that this had been a "a terrible outcome" for the boy, who stabbed Mrs McKenzie seven months later.
The boy was detained for seven years in 2012 after admitting culpable homicide on the grounds of diminished responsibility.
Mr Lorimer said both the boy and his two sisters had been "extremely affected and damaged" from their experiences before going into care.
The inquiry also heard that another boy threatened the teenager with a knife while he was staying with the foster couple prior to the McKenzies, and that the incident was reported to police.
Following this, the boy was not happy that his foster carers did not let him go outside to play. He was quoted at the inquiry as having said: "Maybe the only way it will go away is if I deal with it myself. If I fight him and beat him he will back off."
Mr Lorimer also told the inquiry about an incident where the boy punched a brick wall because he was not getting his own way.
But said he did not think the incident, that had taken place when the child was aged about 12, was very serious.
The inquiry in Motherwell continues.
A boy who stabbed his foster mother to death had been watching inappropriate material on YouTube, a fatal accident inquiry has heard.