Force India have tested both drivers, and as a Mercedes customer likely got access to data from this season to help determine their decision. Add to that the fact that Ocon is massively respected for how he works with the team (Force India, Renault, and Manor were all very pleased with him) and that Wehrlein has a reputation for being a bit of a problem child and the decision starts making sense.
Ocon has done far less F1 testing and joined Manor partway through the season. Considering those circumstances his performances have been pretty good, and Manor themselves have put up their hand and said a problem with the car held him back in Mexico and the USA.