There is not so much wrong with the English grammar, but the idea is not clearly expressed. The word "that" refers to "ideas" not the whole phrase.
You will need to decide what you are trying to say: Are you saying "ideas widen knowledge"? Or you saying that "some ideas widen knowledge, and we must share those ideas". Neither option seems right.
But what I think you want to say is that "the sharing of ideas widens knowledge".
If so, your clause is wrong, since it describes the ideas. You want it to describe the "sharing".
Since "widen knowledge" is the purpose of "sharing ideas", a better way to write your sentence would be:
We have to share ideas with each other to widen our knowledge.
The infinitive gives the purpose of the main clause, it describes the purpose of sharing, instead of describing the ideas. You could also use a participle phrase.