The White House Historical Association says only three presidents' children have attended public schools (source, additional source). Those three belong to Jimmy Carter, Theodore Roosevelt, and Taft.
For Obama, he said it was due to security, privacy, and the private system was deemed as the best fit (they attended a private school in Chicago before Obama became president). He did acknowledge the DC school system was struggling.