Can you find some button up shorts or pants to put on over the diaper that are hard to reach inside of? My son was older, so maybe it won't work for a 2 year old. But he started doing this in daycare and I put some pants on him that button up and are hard to reach inside of and it broke him of the habit. Took about a week.
My other thought is on boards I have seen some moms say this is due to parasites or yeast and they have recommended supplements for it.