Sergio Busquets put Barca ahead in the ninth minute of a first half they dominated but Betis responded well in the second half and they took advantage of Dani Alves' sending off in the 53rd minute.
The impressive Ruben Castro scored two sublime goals in three minutes and Betis were on course for victory before Keita headed home 90 seconds into injury time.
Real Sociedad ended the season on a high as Antoine Griezmann's second-half goal saw off Valencia on Saturday night.
With both sides having little to play for, the game started slowly, but it improved improved after the break as Aritz Aduriz and Pablo Hernandez passed up chances to give the visitors the lead.
Instead Sociedad got the winner midway through the second half as Griezmann slid in to meet Xabi Prieto's cross for his third goal in four games to seal a 12th-placed finish for the Basques, their best in the top flight since coming second in 2003.
Saturday's La Liga Results