I have a dwebble and when I got it to level 24/26, it didnt learn stealth rock. Am I doing something wrong?
Dwebble does learn Stealth Rock at level 24. You can actually teach it to your Dwebble in ORAS by Move Tutor #4 for the price of 8 Battle Points or BP. You can also teach it to Dwebble in B2W2 by a Move Tutor in Nacrene City for the price of 10 Green Shards.
Please note that whenever your Pokémon gains a level and wants to learn a move, you have the option to let your Pokémon not learn the move it wants to learn.
Given this knowledge, you probably "gave up" on teaching your Dwebble Stealth Rock when it wanted to at level 24.