Why did General Gage allow his soldiers to be arrested and tried in a colonial, civilian court after the Boston Massacre?

Gage didn’t have any great choice in the matter. British soldiers have always been subject to civil as well as military law. A court in Boston was just as legitimate as one in London. After the shootings, the sheriff went out and arrested Captain Preston and the members of the guard, and that was that. The soldiers stayed in jail until the trial.
Gage was actually based in New York and learned of the Massacre by correspondence from his subordinates and Thomas Hutchinson, the royal governor of Massachusetts. Hutchinson told him that Boston was a cauldron of resentment and anger over the massacre, so much that British troops had to withdraw from the town to an island fort in the harbor. Gage was in no position to resist the course of justice. He was rather cynical about the colonies and was convinced that Preston and the soldiers would be convicted and sentenced to death.
He really had no option but to go along and hope for the best. In fact, the trials turned out well for Captain Preston and the soldiers, thanks to the excellent defense mounted by John Adams and others.