Is it legal for companies or medical insurance to exclude hearing aids?

Yes, or otherwise they’d be covered. Every state is different in what needs to be covered.