Usually that is the indication of unhealthy plants. Either from some sucking bugs, or you may have applied fertilizer/chemicals that is too strong for the plant to handle.
Hope you can identify the cause of it and eradicate the problem ASAP. Once the plant freshen up and healthy, if the yellow spots stay, then congratulations, you have a beautiful variegated cactus.
Note: If recently you ever applied any chemicals or fertilizer on it, please let us know what chemical is that