Why do universities share test questions?
I am not aware of any university having agreements with other universities about exchanging exam questions and i doubt that such agreements would exist in many places. I would wager a bet that the same is pretty much true on departmental level.

On the level of individual teachers there might be many reasons why exam questions pop up in different places. One has been mentioned by Brian Borchers in a comment (questions taken from textbooks). Secondly, many first- and second-year courses teach pretty standard material which often has not changed for quite a while (e.g. basic linear algebra in many disciplines). For such courses (and even some higher-level courses) the set of questions that are useful as exam questions tends to be limited and so i would not find it surprising to find that most if not all questions have been asked somewhere and have been discussed on the web. Thirdly, it is not unheard of that teachers re-use exam questions from previous years. Fourth: sometimes teachers talk to each other and exchange experiences and material.