Shakespeare was a genius, and could, therefore, have written all attributed to him with the greatest of ease.
It’s not that people question Shakespeare for being middle class. I think it’s pretty well establishedl that all great figures of the mind stand between the overlords and the peasants. You don’t see much of the titled nobility among the British pantheon. Well, Shaftesbury, Cavendish, Keynes, Russell. But nobody else. And needless to say none from the lower orders.
No, it’s all sons of gentry, merchants, doctors, lawyers, perhaps artisans. Shakespeare falls comfortably into that. The problem is that we have no record of schooling after grammar school, and his plays evince knowledge of the classics. How did he know Latin, or if he didn’t how did he make it look as if he did? “He’s a genius” is hardly an answer.
As for Newton, I don’t know his exact status at birth, but he was educated at Cambridge and therefore there is no similar mystery.