Fast answer
Choose Monopoli when the trip wants a coastal base with old-town evenings, beach options, and rail logic that can support nearby coastal movement. Choose Polignano when the specific coastal-town comparison wins the trip. Choose the Valle d'Itria side only when white-town evenings, inland routes, and car-aware planning matter more than sleeping on the coast.
If you only do one thing
For a first Puglia base that wants both sea and evening structure, Monopoli is the safer default than treating every nearby town as interchangeable. Use Polignano as the sharper coastal comparison, and keep Ostuni, Locorotondo, Martina Franca, and the wider Valle d'Itria as a different inland-base decision until each town has its own detailed guide work.