Your hand is determined by the best hand you can make using ANY 5 cards out of your 2 and the 5 community cards.

Hand 1)

Because of this your opponent has A♥ A♣ 10♦ 10♦ K♣ (Two pair, A's and 10's with a K)

You have K♣ K♣ 10♦ 10♦ A♥ (Two Pair, K's and 10's with an A)

So because of this his Two Pair is better than yours.

Hand 2)

This is the same as above, using the 5 best cards, He has A♣ A♥ 3♦ 3♦ K♣ (Two Pair, As and 3's with a K)

You have K♣ K♦ 4♦ 4♠ A♥ (Two Pair, K's and 4's with an A)

You was winning both hands on the Flop (First 3 cards that comes) and then Turn (4th Card) as you had Two Pair where he only have One, the River (5th and final card) paired the board which ended up giving him Two Pair also.

Hope you understand? If not give us a shout and we'll try again

Edit - Seems Carl beta me to a reply but with two replys hopefully it'll help make more sense of your problem