The Lannisters wanted him killed
The Lannisters were searching for a way to get rid of Robb Stark because his army was approaching them.
Tywin made an arrangement with Roose Bolton
Tywin made an arrangement with Roose Bolton to kill Robb in exchange of being the new lord of Winterfell.
Walder Frey betrayed Robb
Walder Frey betrayed Robb and agreed to be a part of the plot. See why Eddard Stark died.
Robb made a mistake by breaking Frey’s promise
One of the reasons Robb died is that he broke the promise he gave to Walder Frey which stated that he would marry one of his daughters.
Robb married Talisa in the wrong time
One of the reasons Robb died is that he married Talisa during the war and before wedding Frey’s daughter. (See Game of Thrones Season 3 Summary)
Robb ignored Catelyn’s advice
Robb ignored his mother’s advice of not marrying Talisa. Catelyn was concerned that Walder might get angry and she was right.
Robb never expected to be betrayed by Walder
Robb went to apologize to Walder but he never thought he would be betrayed by him. Robb , Catelyn and many of their men were taken by surprise. (See Game of Thrones Summary: Episode 3 – Season 2 – What is Dead May Never Die)
Walder didn’t care about his own wife
Catelyn threatened Walder that she would kill his wife if anything went wrong but Walder was totally indifferent and he ordered Robb to be killed.