Resting-state fMRI studies remove subjects that fail motion quality control criteria. Motion is particularly problematic in studies on children and neurodevelopmental disorders, including autism spectrum disorder (ASD), because participants are more likely to move than neurotypical adults. We find that subjects with more severe ASD symptomatology are more likely to be excluded. To address the sampling bias, we define a target parameter for the difference in functional connectivity between ASD and typically developing children. We call this target parameter the deconfounded group difference, which utilizes the distribution of diagnosis-specific behavioral variables across usable and unusable scans. We estimate the deconfounded group difference using doubly robust targeted minimum loss-based estimation with an ensemble of machine learning methods for the propensity and outcome models. In a study of 406 children (148 ASD), we find more extensive differences than the naive estimator. Our findings suggest the deconfounded group difference can reveal the pathophysiology of neurological disorders in populations with high motion.