Because Swiss scientists and businesses want to collaborate and trade with European partner networks of science and industries.
One of the EU main principles is collaboration and win-win. It is not zero sum. Example: The Netherlands is wealthy and a net contributor, but would be poorer off from not being in the EU.
Also, be aware that your question easily leads to a follow-up question:
"Why don't we fund our own research and innovation?"
=> "Why do we fund research and innovation?"