What you should do is admit that you were wrong and apologize to him, explain to him that you weren't trying to be deceitful and that you thought of it as a friendly lunch since you do not like him in that way and that if you hurt him you're sorry, your boyfriend probably feels disrespected and like you didn't care about his feelings if he were to find out and you're going to have to prove to him that wasn't the case at all. I think you should have told him instead of him finding out on his own maybe he wouldn't have taken it the way he has he probably would have taken it more calmly. Be completely honest with him about why you met him for lunch if it was to see if you still had feelings then tell him that and if it was just a friendly meeting to catch upon how he was doing to him exactly what was the purpose for you accepting his lunch proposal if he see that you are trying to be honest he will start to trust you again but it may take some time.
The only way you are going to get his trust back is to tell him the truth and why you felt the need to go to lunch with an ex. He may be thinking you went to see if you could rekindle some kind of feelings you have for him and if that isn't true you are going to have to tell him that. Honesty is always the best policy if your boyfriend felt uncomfortable with you meeting your ex and you did it anyway then you have to prove to him that you can be trusted and next time something like this happens tell him immediately about it and tell him the truth.