You did not say how big the pot was, or how many people limped in or raised before the action was on you -- so I will assume this was blind-vs-blind, and there were no antes.
Going all-in for 24 big blinds against a weak player out of position is not the best strategy. In this particular instance, since he actually had 75o you were about a 2:1 favorite in a hot/cold analysis when all the money went in. So, your play was +EV, but that doesn't make it the best play.
There are three factors that contribute to how big of an edge you have in a hand:
- Skill advantage
- Positional advantage
- Card advantage
They are in order of most important to least important above. Which is to say that your actual cards, while not unimportant, is the least important variable that factors in to how big of an edge you have.
By shoving preflop, you give up all of your skill and positional advantage in favor of card advantage. However, because your skill advantage and your positional advantage weigh more heavily than your card advantage in how big your edge is, you stand to win more by playing pots against this opponent.
If the roles were reversed and you were the weaker player, then I would advise shoving all-in,because that neutralizes your opponent's skill and positional advantage. But the roles weren't reversed. You had every advantage, but you leveraged the minor one.
You want to play pots against weaker opponents, especially when you have position.