Why there isn't provision for writing comment on published articles like social media?
This is just opinion but the question seems to call for just opinion, of course. But, my opinion is that when the paper has been published it is too late for general public commentary on it at the place of publication. Researchers have better things to do than fend off trolls for example and much published research will draw the trolls. 

The process for getting published, of course, is generally very rigorous with informed comment being fed back to the authors. They get (or should get) the feedback from people who are informed about the field and what has been done previously and what is important. 

If a person, genuinely, has an issue with what is published the preferred avenue of response is to publish something better, citing the original. 

Most authors can, of course, be contacted privately, either with praise or concern. The author can see it and take it into consideration. This can lead to better future publications benefitting everyone. 

However online controversy about published research is less valuable and draws the authors into non productive response. 

When something published is egregiously bad, however, comment often occurs in letters to journal editors or even, in extreme cases, in the general press. Sometimes corrections take a long time to occur, such as in the Stanford Study. But I doubt that social media type commentary would improve that situation.  

tl:dr; The Trolls will Troll.