Comment on
Why do blogs and general websites(not social media and shopping websites) pay for hosting?
Because lots of people are stuck with CMSs like Wordpress and need to have nginx/PHP/MySQL running somewhere.
In order to use something like GitHub Pages, you need a proper deployment pipeline, which a regular person won’t be able to set up.