I had a bad torn meniscus so I had a surgery two weeks ago, why does the back of knee hurt when I move it sometimes?

Inflammation. The most likely reason is due to swelling/inflammation in the area of your meniscus tear/surgery as most meniscus tears tend to be in the back part of the knee. Sometimes sutures are placed into the meniscus to repair it back to the lining of the joint. Fluid in the knee also can leak into the soft tissues in the back part of the knee which can lead to discomfort as well.
Let me explain. One of two thing . It could be from the surgery and during manipulation of the knee this happened. The other reason could be complication of the surgery few people have tendency to have blood clots which cause that .