The answer (IMO) is curves. Matching the curve of the insulin to the curve of the food absorbsion is always fun and mismatching causes those nice spikes.
The food curve is due to the amount of carbs and the glycemic index. Bagels are one of the most evil kinds of bread going, as in they whack into your system at close on the speed of light. Whilst I like bagels, I don't do them often and if I do I accept that my 2 hour number may be a little high. I'm guessing that's the same with you; you carb counted just fine, as your number came right when the insulin eventually caught up.. If you don't already have one, you can get books with GI / GL values in them as well as carb values. Very helpful, though GI is just a guide IMO. It will tell you what is LIKELY to be good or bad in terms of rapid rises. As we all differ, some can cope with certain foods better than others. No idea why, but it's true
What insulin are you using? I changed from Novorapid to Apidra last year. Apidra peaks quicker and (in me and many others here) tends to cope better with the high GI foods and hence minimise the 2 hour peaks. The downside is when you eat a high protein / high fat meal you may well find you'll need to split your Apidra dose otherwise you'll go hypo after an hour and then high later on... I know this can be the case with other rapid insulins, but in me it is even more important with Apidra.
Gary