It wasn't specifically that they needed an "astromech", just that they needed a mechanically-capable droid and an astromech happened to be what the Jawas were offering.
Similarly with Threepio - he needed a translator, and a protocol droid with an extensive translation matrix was available. It was the translator part that mattered far more than the protocol part.