Given a sorted array with n integers, how to find the element that has no duplicates?
This is a classical problem when the array isn't sorted, which has a surprising, almost magical linear solution.
But here, with a sorted array, your idea is great.
The unique element will have an index $u$, and every element $a[i]$ will be exactly the same as either $a[i-1]$ or $a[i+1]$ (which are different).
Assuming that arrays start at $0$, the shape of the (sorted) array is first a list of elements where $a[2i] = a[2i+1]$, then $a[u]$, then a list of elements where $a[2i-1] = a[2i]$.
So to decide where $u$ is, you can take a random position in the array, and just have to ask whether you're in the first part (where doubles start on even indexes) or the second part (where doubles start on odd indexes).
This takes a constant number of operation by question, and each question reduces the size of the search array by $2$ (if you sample in the middle, of course).
So, to synthesize :

By looking in the middle, you ensure that the next part you have to look at will be as small as possible
This yields a $\log(n)$ algorithm
This approach is probably optimal, but the proof that there isn't something better to do must be quite hard, so I leave it to someone else ^^