The accent was chosen for him to match his character. Other cast members also had to moderate their accents, albeit to a lesser degree.
John Boyega: Doing an American accent is quite interesting. I remember auditioning and there were talks about whether Finn was going to be doing an American accent, or a British accent. I was very happy that they chose an American accent because one of my favorite characters is Han Solo, and Han Solo has this very boyish, charismatic American accent and it makes him sound like he's king of the world. The accent does help me channel that energy a bit. It's great for Finn, and it does help with making him funny and relatable.
Star Wars: The Galaxy's Greatest Heroes - John Boyega Looks Back on Creating Finn (Exclusive)
and
You coached the two leads: John Boyega and Daisy Ridley. Can you share
some of your experiences working with them on their accents?
Daisy is a Londoner and JJ Abrams wanted her and other members of the
cast to be neutral, not betraying any regional sounds in their
accents. John Boyega’s character Finn was to be American, so we did
the preparatory work and he produced a faultless accent.
Do you know the reason the decision to have John Boyega speak with an
American accent was made?
As far as I know the decision about Finn’s accent was made early on in
casting.
ANDREW JACK: DIALOGUE COACH (THE FORCE AWAKENS) - INTERVIEW: JANUARY 2016
This tallies with Boyega's interview, below, in which he states that he tried the audition with his (natural) British accent and was told very early on that it 'wasn't working out'.
"I tried it in the British, but it didn't work out.... They were just like "uh, John, I don't think it's right, let's go with American"