Given the traditional ACM copyright license, is it legal to publish the paper on ResearchGate?
No. Researchgate is a for-profit organization that makes money from ads and job adverts. See for instance http://osc.universityofcalifornia.edu/2015/12/a-social-networking-site-is-not-an-open-access-repository/.

Also, if you share your paper there, the Researchgate TOS state that you, not them, have to cover all the legal costs in case they get sued (Article 3, comma 5).