How will offspring Pokemon inherit the Pokeball when breeding in Sun/Moon?
Solution 1:
According to Bulbapedia:
In 7th generation, if a male and female Pokémon of the same species are bred, the offspring will have an equal chance of inheriting either parent's Poké Ball.
Also, when breeding a male or genderless Pokémon with Ditto, the Poké Ball of the male or genderless Pokémon will now be passed down to its offspring.
Here's a summary: (Credits to Saiph-Charon)
For the purposes of inheriting Pokéballs, parents in a Master Ball or Cherish Ball are always treated as being in a standard Pokéball as before.