They have made it clear that when Frank Miller came to town that they (the collective group of outlaws) were going to kill the Marshal. They undertake that threat when he does arrive and that allows the Marshal to finally act. The clip attached demonstrates this.
There are also two other reasons:
- High Noon was created in the era of the Hays Code - This was a film standard which movie studios voluntarily adhered until the mid-1960s. Under this code, movies were held to a ridiculously high standard where indiscriminate violence couldn't be shown and that any hint of law enforcement corruption must end with film punishing the transgressor, If Will (the Marshal) had shot the Miller gang or arrested them without charge under the "logic" of the Hays Code, he would have had to be "punished" at the end of the film.
- Gary Cooper was an actor who had a great of "difficulty" playing roles which required a great deal of subtlety - There is a film from 1959 called "They Came to Cordura" where Cooper's character was supposed to have been in a prior homosexual affair with a character played by Tab Hunter. Although Cooper was growing ill with the prostate cancer which eventually caused his death, he also did not feel comfortable being perceived as less "manly" than he was normally portrayed and he insisted that his character be "toughened up" which actually undercuts much of that film's narrative.
Had Cooper's been written as ambushing Miller's men before he arrived or arresting them illegally, he would have likely objected strenuously. As it was, he had serious reservations about the perceived "socialist elements" of his High Noon part which is probably his best role.
So as soon as Miller and his men come into town and attempt to kill the Marshal, he is then "free" to commit violent acts against them.