If you want to investigate further why you experienced such trouble, CBP takes calls from the public at 1-877-CBP-5511. Perhaps you'd also like to raise the matter with your congressional representative.
Rest assured that you're not the only U.S. citizens who have been subject to questioning at the border. My daughter and I travel with different surnames, a point I've been asked about at Dublin/Shannon airports on more than one occasion. (Memo to CBP: It's okay for a woman to continue to use her maiden name after marriage!)
The very best of luck with your future travels. Let us know if you have a problem the next time. Here's betting that all will be well.