The reason for this is that movies are attempting to be exciting and dramatic and to appeal to audiences. For this reason, they need to change the details so as to ensure that they will be commercially successful.
For example, the movie "The Patriot" from 2000 showed a number of inaccuracies in order to make it more exciting and more appealing to patriotic audiences. It had the lead character's plantation in South Carolina being worked by free black employees, which never happened in that place and time. It had Maroon fugitive slaves celebrating the character's son's wedding when the whites take refuge with the fugitives. It had George Washington and the Continental Congress offerring freedom to slaves who fought for just one year in the Continental Army. This, too, never happened.
But all of these things make the film more dramatic and more appealing. They show the American patriots as good people, even on racial issues. This is much nicer for modern audiences than the truth is. It also heightens the drama (as does the exaggerated brutality of the British in the movie). For these sorts of dramatic/commercial reasons, historical movies do not typically stick closely to reality.