I think you are
The Null Hypothesis
I am neither a living being nor an object.
The Null Hypothesis is a statement or position. It is abstract rather than being a physical object.
I have hundreds of friends, but they usually reject me.
It is used by many scientists as a default hypothesis but the usual intent is to reject it in favour of an alternative hypothesis describing a new phenomenon.
Sometimes they let me join them, but it's always temporary.
When proving the existence of a certain phenomenon, a temporary acceptance of the null hypothesis may be reasonable until a contradiction is reached.
Although without him none of us would exist, the sun is source of my loneliness.
I think this refers to the Geocentric Model of the Universe which is one of our earliest examples of the Null Hypothesis being rejected. In fact, we now view it that the Earth orbits the Sun, instead of the other way round.
You might think I am useless, but my very existence brings balance to the passage of time.
Usually, most of us already know the Null hypothesis to be wrong so it seems useless but it is important always, in science, to consider the counter argument and provide balance to your approach.