Here's one way to formulate the argument from pain against theism: "Granted, beings like us need an intense sensation normally triggered by damage that in turn normally triggers strongly aversive behavior. But if God were designing us, we would not expect this sensation to be painful. We would instead expect some intense non-painful sensation to be triggered by damage that in turn triggers strongly aversive behavior. Hence God did not design us." This version of the problem of pain is based on the Possibility Premise:
(PP) It would be possible to have a non-painful sensation that normally has the same triggers as pain and normally leads to the same aversive behavior.
Now, the typical atheist is a naturalist and the best naturalistic theories of mind are functionalist theories on which mental states are defined by their functional interconnections. If functionalism is true, PP is unlikely to be true. This creates a dialectical problem for the typical atheist running the above version of the argument from pain.
Here's one way to see the dialectical problem. Either there is good reason to believe in PP or there isn't. If there isn't, then the theist shouldn't be saddled with PP either. Nothing in theism commits one to PP. It's true that the typical theist is a dualist, and dualism does make PP plausible, but even that is a fairly weak "make plausible": it is easy to be a dualist who denies PP. This is especially true if what pushes one to dualism is not the problem of consciousness but the problem of mental content. Now if there is good reason to believe in PP, then it's fair enough to use PP in an argument against theism. But now the dialectical problem is that PP also provides significant evidence against functionalism, and hence against naturalism, and hence against typical versions of atheism.
Of course, one can give versions of the argument from pain that don't make use of PP. What I say only applies to one version of the argument from pain.