Profile add-to-group feature doesn't work with petitions
This is probably a bug (or, perhaps more appropriately, an incomplete feature).  There have been a number of features that apply everywhere but in petitions--it's newer than some other features, and it doesn't have as many users as contribution pages or event registrations.

To double-check, visit a demo site (found via https://civicrm.org/demo) and confirm that the same thing happens.  Double-check (on your site and the demo) that you haven't checked the "Enable Double Opt-in for Profiles which use the 'Add to Group' setting" in Administer - CiviMail - CiviMail Component Settings, as that may indicate a problem with the opt-in emails going out (though you'd see problems with contributions and events too in that case).

Finally, assuming the problem's on the demo too, submit a bug report at issues.civicrm.org.