The king wanted 100 foreskins in exchange for his daughter in marriage. This could have been achieved without killing anyone. But instead of killing 100 people David and his men killed 200 people. Despite this David is said to be a man after God's heart. (1 Samuel 13:14)
It's only fair I give you a chance to demonstrate how "this could have been achieved without killing anyone".

Note... 100 foreskins
of the Philistines. How could David get 100 foreskins of the Philistines without killing anyone, especially since the king expected him to get them... not from rotted corpses buried somewhere in the wilderness?
Yes, David was a man after God's own heart. That's how he succeeded.
God gave David the victory.
Note the account in 1 Samuel 18 reads...
17 Then Saul said to David, “Here is my older daughter Merab; I will give her to you as a wife. Only be valiant for me, and fight the Lord’s battles.” For Saul thought, “Let my hand not be against him, but let the hand of the Philistines be against him.”
18 So David said to Saul, “Who am I, and what is my life or my father’s family in Israel, that I should be son-in-law to the king?” 19 But it happened at the time when Merab, Saul’s daughter, should have been given to David, that she was given to Adriel the Meholathite as a wife.
20 Now Michal, Saul’s daughter, loved David. And they told Saul, and the thing pleased him.
21 So
Saul said, “I will give her to him, that she may [f]be a snare to him, and that the hand of the Philistines may be against him.” Therefore Saul said to David a second time, “You shall be my son-in-law today.”
22 And Saul commanded his servants, “Communicate with David secretly, and say, ‘Look, the king has delight in you, and all his servants love you. Now therefore, become the king’s son-in-law.’ ”
23 So Saul’s servants spoke those words in the hearing of David. And
David said, “Does it seem to you a light thing to be a king’s son-in-law, seeing I am a poor and lightly esteemed man?”
24 And the servants of Saul told him, saying, [
g]“In this manner David spoke.”
25 Then Saul said, “Thus you shall say to David: ‘The king does not desire any dowry but one hundred foreskins of the Philistines, to take vengeance on the king’s enemies.’ ” But Saul thought to make David fall by the hand of the Philistines. 26 So when his servants told David these words, it pleased David well to become the king’s son-in-law.
What part of this do you find unacceptable, or wrong?
David was poor, and felt he could not afford a dowry worthy of the king's daughter, so Saul saw an opportunity to place on David a challenge he could not refuse.
This challenge not only sought to get David killed, but it would challenged his position as commanding officer... if he didn't accept.
Either way, the king sought to removed the rival of his fame. Either by death, or cowardice, Saul planned on succeeding.
God made certain that Saul failed, and also see that David had God's support.
Again, remember...
there is a war in progress, and David is a general - chief over Saul's armies, and at war with the Philistines - the enemy.
5 And
Saul set him over the men of war, and he was accepted in the sight of all the people and also in the sight of Saul’s servants.
6 Now it had happened
as they were coming home, when David was returning from the slaughter of the [c]Philistine, that the women had come out of all the cities of Israel, singing and dancing, to meet King Saul, with tambourines, with joy, and with musical instruments.
7 So the women sang as they danced, and said:
“Saul has slain his thousands,
And David his ten thousands.”
8 Then Saul was very angry, and the saying displeased him;
What part of this do you find unacceptable, or wrong?