Why did God give us 10 commandments and not any other number?
I suppose one could claim that ten commandments were all that God needed to express His summary of the Law given to Moses. It was short enough to fit on two stone tablets (Exodus 34:28; Deuteronomy 4:13), but still expressed enough detail for the people to understand what God wanted from them.
Yet, there is a bit of subtly going on in the background. There are actually eleven imperatives in the Ten Commandments, they are just grouped to make ten.
Numbers have meaning to people. If I say "nine one one," people in the United States immediately think about an emergency since this is our universal phone number to contact emergency personnel. But if I say "nine eleven" we think about the tragedy that occurred on September 11th, 2001. The number thirteen has long been associated with unlucky things. It is so ingrained in society that buildings avoid having a thirteenth floor.
Hebrew society was the same. Without going into all the various numbers, we will note that in Israel the number ten was associated with completeness. You have ten fingers and ten toes, so you are a whole person. The number 10 was used as a round unit, much like English speakers talk about an even dozen (12). When Hannah complained about her barrenness, her husband responded, "Am I not better to you than ten sons?" (I Samuel 1:8). Ten was the smallest civil unit (Exodus 18:21) and the smallest military unit (Deuteronomy 1:15).
The idea of completeness even shows up in combinations. The number 40 represented a complete period of trial, probably because of the forty years in the wilderness and the memory that the rain fell for 40 days and nights at the beginning of the flood. It was a complete trial because it was a multiple of 10.
Hence, there were Ten Commandments because they were a complete summary of the law given to Moses.