I solved it the following way
$query_args['tax_query'] = array(
'relation' => 'OR',
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $categories,
),
);
Apparently I had to explicitely say that I was filtering through the taxonomy “category”. I could see that thanks to the comment from @birgire. Thanks man!
Update
As petition, this is the request:
SELECT wp_posts.*
FROM wp_posts LEFT JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1 AND (wp_term_relationships.term_taxonomy_id IN (1,8))
AND wp_posts.post_type="post"
AND (wp_posts.post_status="publish"
OR wp_posts.post_status="private")
GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC