Gastrodon learns stockpile through breeding as an egg move. Gastrodon is in the Amorphous and Water1 egg groups so any pokemon that learns stockpile and is in the same egg group can breed with gastrodon/shellos to have a shellos that knows stockpile. The only pokemon I have found to fit this criteria is Pelipper who is in the Water1egg group who learns stockpile at level38. At that point you would then level up shellos to gastrodon so that you can have a gastrodon that knows stockpile.
I know this is time consuming but it is the only way to get stockpile on a gastrodon.