1 - This is not the Spanish Opening as Black did not play 2...Nc6
It appears to be a rather poor trap in the Open Game by Black against a White player that might be inclined to play the Spanish:
- e4 e5
- Nf3 a5? { leaving the e5 pawn undefended }
- Bb5? { avoiding to capture the undefended e5 pawn }
...Nf6!?
- d3?? c6
- Ba4 b5
- Bb3 a4
or perhaps from the Petrov's Defense by reversing Nf6 and a5
2 - Either way White should not have played Bb5. Bb5 is not a normal choice in the Petrov's Defense for White. Nxe5 would be better. And Bb5 is simply a tactical mistake after the opponent plays 2...a5.
So the conclusion is to not try and find a way out of this horrible position but to avoid getting in this position. If you decide to play a certain opening, be it the Spanish Opening or whatever, and you don't make your decisions based on your opponent's replies then you will fall for traps. If you are going to play the Spanish Opening, then you should know how to play against the Petrov's Defense and you should be aware of the a5, c6, b5, a6 trap against Bb5. It is a common theme in many openings involving Bb5 and Bf5.