"Paul, having become indignant," that is, being aroused and agitated. By shutting her mouth, even though she was speaking the truth, he teaches us not to admit demons to ourselves, even if they take on the appearance of defending the truth, but to block every occasion of temptation for them and not to listen to anything they say. If Paul had paid attention to the testimony of this spirit, the latter would have deceived many of the believers. Therefore Paul at first not only did not accept, but rejected its testimony, not wishing to increase the number of his signs. But when the spirit persiste...d, then Paul commanded it to come out of the woman. Thus, the spirit acted craftily, but Paul acted wisely.
Source: Commentary on Acts