Dataview task queries defaults to always include subtasks if available. This means that if you filter matches a task, which has subtasks, it’ll display the task with subtasks regardless of whether the subtasks matches the filter or not.
CSS can be used to hide these subtasks in general from the query results. See List tasks without sub-tasks - #2 by mnvwvnm
Presenting only uncompleted subtasks should be doable with CSS too, at least when in reading mode.