The expected value refers to the value for a person who decides to purchase one ticket.
And that value is the sum of the values of the different possible scenarios.
There are two scenarios, wining and lossing.
Note that we need to substract the cost of the ticket (i.e. $5) from the return.
Winning:
Probability 1 out of 500 chances
Return expected: ($100 - $5) *1/500 = $95 * 1/500 = $0.19
Lossing
Probability 499 out of 500 chances
Return expected: (0 - $5)*499/500 = -$4.99
The expected value is the sum of the two returns: $0.19 - $4.99 = -$4.80 (it is negative).