Messi also helped set up a goal by substitute Arturo Vidal, but the league leaders were always trailing after Junior Firpo opened the scoring in the 20th minute.
Messi brought Barcelona a goal back from the penalty spot past the hour mark, but Giovani Lo Celso found space in the box just three minutes later and powered it home past Marc-Andre ter Stegen who got a touch.
Real Betis took advantage of their numerical strength just two minutes after red card was shown to Rakitic to make the scores 4-2 in the 83rd minute - Sergio Canales the goal scorer.
Barca's previous home defeat came on 10 September 2016, when they lost 2-1 to Alaves.
His second was a tap in from close range.
Valverde also confirmed goalkeeper Marc-Andre ter Stegen is fine to play, despite having been omitted from Germany's squad for the upcoming global window to rest a minor shoulder injury. "Winning at the Camp Nou requires concentration and doing everything very well".
"We understand that any player theoretically can play the game, but of course there is always a period where you need to be careful", he said.
William Carvalho produced a brilliant through-ball to release Junior down the left and he cut in on to his right foot in front of Sergi Roberto before beating Ter Stegen at the near post.
Betis were soon pouring onto Barca's defence again, with Junior's cross evading everyone before finding Lo Celso on the opposite side.
Vidal replaced the jaded Arthur Melo at half-time and shot within a minute of the restart. MESSI's first goal came from the penalty spot, a well executed strike into the top corner of the net.
Gio LO CELSO also scored, his was a shot which goalkeeper TER STEGEN tried to catch but it went through the hands of the German.
In a breathless finish the impressive Vidal made it 3-2 on 79 minutes, but Rakitic was sent off for a second bookable offence two minutes later and Canales quickly restored his side's two-goal cushion from Junior's cross.
Messi added his second in injury time following a VAR referral but it wasn't enough to stop Barcelona from stumbling to defeat. The video assistant referee deemed Messi onside but there was no more late drama as Betis held on for a shock victory.
- Daesh Reportedly Claims Responsibility For Melbourne Attack
- Transport minister Jo Johnson resigns over Brexit
- Niagara Falls Bridge Commission to mark WWI anniversary with bells
- Ferocious winds whip California fires as death toll rises to 31
- Gary Neville discusses Man City weakness ahead of derby
- Fortnite headlines Xbox One mouse and keyboard launch lineup
- Pete Davidson apologizes for mocking veteran, congressman-elect Dan Crenshaw on SNL
- Porous Manchester United represent Jose Mourinho's worst nightmare
- Juan Foyth unlikely hero as Tottenham Hotspur beat Crystal Palace
- Dwyane Wade delivers a fiery defense of Carmelo Anthony amid Rockets reports