Why did Gus kill Victor?
It was a message for Walt and Jesse. It was a visual statement that everyone has their place and anyone that oversteps it will see his wrath. It shows the viewers a new side of Gus that was previously unseen. Gus is more than capable of getting his hands dirty. He has a dark side to him that becomes increasingly apparent as the series progresses.
Victor oversteps his bounds when he starts cooking in the lab. Just because Victor may know the steps to creating the meth, which he doesn't as he nearly forgets, he is not educated nor familiar with chemistry. Even Jesse is knowledgeable due to his tutelage from Walt, unlike Victor. Essentially, Victor failed to protect Gale, failed to keep Walt and Jesse in line, made himself seen at the scene of the crime, wasted essential resources, and ruined a batch of Meth. Of course, now everything needs to be scrubbed down and cleaned since we all know how crazy Walt is about purity. So lets add wasted time to the batch of missteps by Victor. Pun intended.
These mistakes resulted in a gruesome death for Victor, a consequence for his actions. It served as a message to Walt and Jesse. It reveals more of Gus's character to both Walt and Jesse, including the viewer.
I hope this helps you and anyone that may read this better understand the scene.