Hollywood is all about pushing the social boundaries in order to maximize profit. F-words weren’t allowed in PG-13 but now they can have 1 (i’ve seen a few with 2 and I think one with 3). As the times change, Hollywood tries to numb our sense of what’s acceptable for people to say and do. Pre-marital sex used to be heavily frowned upon, and now it’s in every movie and TV episode we watch.
The majority of people feel as though children aren’t supposed to have terrible language, but the point of showing a kid curse so much is to try to make people accept it. The more children start cursing, the more acceptable it comes, the more F-words PG-13 movies can have, the worse the language in PG gets, and it continues down the line until all audiences can be ok with watching every movie that gets put out. This makes the most money for the film companies.
Since fewer people will see an R-rated movie because of it’s content, the movie won’t make as much money. The only way to change that is to make everyone accept the content.
To answer your question though, they didn’t make him say those things because if he wasn’t OK with it, they would have chosen another 10 year old that was OK with saying them. So most likely he chose to memorize and recite them.