Criticism of big tech in Leo XIV’s first encyclical contrasts with the fact that the Church has no problem buying stocks in the industry