Why does an mercury ore exist as HgS?
Why $\ce{HgS}$ and not $\ce{HgO}$?

Because of HSAB. F'x has already answered a previous question of why mercury has propensity towards thiols(or in general sulfur). Quoting the relevant information:

In Pearson's HSAB theory (hard and soft acids and bases), the reason
the $\ce{S-Hg}$ bond is be stronger than the $\ce{O-Hg}$ can be
explained because $\ce{S^2-}$ is a soft basis and $\ce{Hg(II)}$ is a
soft acid, making a good fit while $\ce{O^2-}$ is harder.

If this answer helps, please make sure to upvote F'xs answer.