If you were meeting a girlfriend for lunch, would anything have been different with that lunch date? If not then nothing is wrong with having lunch with a friend. IF on your chats on line, if you would have been comfortable copying and pasting your conversation to your boyfriend, then nothing has happened that is wrong.
Men and women can be friends without it turning to sex. It is not the normal thing all people do. If you and your boyfriend,(bf) were in the same town, then you could have had lunch with your bf instead, but again, even if you were in the same town, a lunch date from time to time is not unreasonable, as long as it is a platonic relationship. These can turn dangerous, and many affairs start with something as innocent as that.
I will tell you of an experience of my own. I have a female friend that I have been close with for years, (since she was four and I was 11). Back when she was married, we both enjoyed hiking, and her husband did not. He would watch their children while the two of us went hiking many times. Nothing ever happened between us, and it could have been another man, and it would have been the same. This is not the norm, but it is not wrong. The thing that should have happened, was her husband should have taken at least a small interest in hiking, so the two of them could have shared that, instead of it being me, but again it was a totally innocent thing.
I think the acid test for you is what I basically said above. If on your chatting, you would have been comfortable if your bf had been sitting beside you while chatting, and if everything that happened at lunch would not have changed if again, your bf had been sitting at the table beside you, then you have no reason for guilt.
Things CAN happen and I am sure many would post that you are flirting with disaster, which in your case did happen as far as your bf's reaction, but it is his problem with insecurity, not yours. Maybe, since you said he has not been acting as close to you lately, that he used this as an excuse and it was something he was already wanting to do, but was not mature enough to come out and say it.
You may be more confused after reading my post than you were before, I hope not, but from my point of view, especially since it was not when you had an opportunity to be with your bf, you did nothing wrong. It was above board, you told him about it, and if he had problems with it, he should have expressed these with you, not go off like a moron. I hope this helps, and good luck