I really don't understand why we lost the war. We thought we will won the war because we used less attacks.
It doesn't matter how many attacks you use in a war in this type of situation. It is the overall destruction of the enemies' bases that will be the tiebreaker.
In this case, your clan got 96 percent overall destruction while the other clan got 96.2 percent. That means the other clan wins as they got 0.2 percent more destruction that your clan did. Close, but all it needs is higher score to win.