Here are some random thoughts based on our month along the Adriatic coast a few years ago.
For the very best child-friendly beach, start in Le Marche (just north of Puglia). We stayed in Senigallia and absolutely loved it. Miles of sandy beach. Charming little historic center. Amazing restaurants. A castle/fort, and daily markets. Nearby are Caverns of Frasassi which the kids might enjoy.
Then we traveled south to Trani, in Puglia. Trani is an appealing port city. But with kids you might prefer staying in a little town just north of Trani called Margherita di Savoia. It has a huge salt plain which produces more than 5 million tons of salt per year. Kids might enjoy the sight of that. It also has a gorgeous huge sandy beach (much like the beach in Senigallia).
From there we went to Matera. No beaches here but prehistoric cave dwellings. Would be a good place to spend a night or two.
Then we went to a Masseria in the Val d'Itria. A masseria is the Puglian version of an agriturismo. Ours had animals and fruit trees, a swimming pool, and was about a 5 minute drive from the beach at Torre Canne. We stayed at Masseria Montenapoleone, but there are lots of them to choose from. We used this as a base to see the trulli villages (the kids really should see those). No walking to restaurants from a masseria, but ours had a guest kitchen, stocked with olive oil and other basics, plus food harvested on the masseria. It was a nice change of pace. EDIT: I just noticed your interest in Ostuni. There are lots of masserias around Ostuni too ... would be easy to reach the trulli villages, Polignano, etc. from there.
We ended up in Lecce, which I would not recommend with kids. You'd do much better in Gallipoli, which was one of our favorite day trips. Very picturesque fishing village.