I'm very tired right now, so my math could be wrong...but he had pot odds to call there. Mathematically speaking you did the correct thing by investing ahead, and he did the correct thing by calling with the odds he was getting for his draw.