Why do double-ended ILS runway share the same frequency from both sides?
Listen to the identifier... That will tell you if you have the 10R I-MRY or the 28L I-MTB ils.  Some runways use the same frequency like this, while others use different frequencies for opposite direction ILS's.  The identifier will always be unique, though.

The 10R transmitter doesn't operate at the same time as the 28L transmitter. One transmits "this" ils beam in "this" direction using "this" ident on whatever frequency; the other transmits a different ils beam in a different direction using a different ident; the fact that it is or is not the same frequency is incidental.

Usually, the two reciprocal ILS's to the same length of pavement use the same frequency, with one switched off when the other is switched on.  MRY in the OP is a good example of this, and most other airports I looked at have the same behavior, but this is not universal.  Reno, NV -- KRNO -- is an example where the opposite ILS's are not on the same frequency: 16R ils is 110.9, but 34L ils is 109.9. Same pavement, different frequencies.  Also, Detroit, MI -- KDTW -- appears to have two full ILS's set up for runway 4R/22L, with one pair on 111.75, and the other on 111.95.

One other note: the various flight simulator programs may or may not accurately model this behavior.  Some may simply have every ILS "on" at the same time, so if you're west of "this" airport, you'll receive the ILS for landing east, and vice versa.  Works well for a flight simulator program, but that's not how the real world works.  It takes a call to tower to have the one ILS turned off and the other turned on, and it isn't something they prefer to do repeatedly or on short notice.  In the sim, it's convenient to fly approaches back &amp; forth to 16C then 34C then 16C and so on, but even if traffic permitted, in the real world they'd probably prefer you flew your ILS's to one runway, and use something that doesn't need the ILS or the LOC when landing in the opposite direction.