I ran a computer program to find all solutions. Armed with the answer, I've tried to construct an argument for why those are the only solutions, but have not quite managed that.
Firstly, I'll assume without proper proof that:
The $5$ is in the centre, and all four lines through the centre have a sum of $15$. For this puzzle these lines then can produce a value of $10-5=5$.
The four lines therefore use the four pairs $\{1,9\}$, $\{2,8\}$, $\{3,7\}$, and $\{4,6\}$. Note that each pair sums to $10$, and there are two even pairs of numbers or two odd pairs of numbers.
Now those remaining numbers need to be arranged so that
the outer rows and columns also can produce a value of $5$. Note that if $a+b-c=5$, then we need exactly one or three of the numbers $a$, $b$, $c$, to be odd. They cannot all be odd, because there are only two odd pairs. Each outer row/column must therefore have exactly one odd number. This means that the even numbers are at the corners, and the odd numbers at the edges.
To reduce by symmetry, we can rotate or reflect the square so that $2$ is in the top-left corner (putting $8$ in the bottom-right) and $4$ is in the top-right corner (putting $6$ in the bottom-left).
2 . 4
. 5 .
6 . 8
Note that if $a+b-c=5$, then $(10-a)+(10-b)-(10-c) = 5$, so we only need to check that the top row and left column work. The opposite row and column will take care of themselves.
For the top row we can have $4+2-1$, $4+3-2$, and $7+2-4$, but $9$ does not work.
For the left column we can have $6+1-2$, $6+2-3$, $9+2-6$, but $7$ does not work.
This leaves the following solutions:
2 1 4
3 5 7
6 9 8
2 3 4 2 3 4
1 5 9 9 5 1
6 7 8 6 7 8
2 7 4 2 7 4
1 5 9 9 5 1
6 3 8 6 3 8
There are $5$ solutions, or $5*8=40$ if you rotate/reflect them.
I have not found any proof for the assumption I used. My computer program shows that there are no other solutions. Note that if we allow one of the diagonals to have a different number (i.e. only the rows, columns and one diagonal produce matching numbers) then solutions are produced that do not use that assumption, e.g.:
1 3 5
9 4 8
7 2 6
This square produces $3$ on all lines except the "/" diagonal.