You called his all in with middle pair after you called his preflop raise and checked to his all in post flop.

You deserved to lose.