What you're seeing is referred to as "ghost touch" and comes about due to electrical noise on the digitizer signal lines being misinterpreted by the processor as touch inputs. This is almost always a result of damage to the digitizer, possibly as a result of being dropped or banged, or exposed to liquids. The damage doesn't have to be visible; it could be that the delicate connections between the glass and the flex cable have been disrupted, which you can't see and can't fix.
At any rate, assuming you've tried all the software solutions including doing a full restore to factory settings, then you're pretty much left with it being a hardware problem. In almost all cases replacing the digitizer will fix the problem. Of course, on your tablet the digitizer is bonded to the LCD, so you'll be replacing the complete screen assembly.
Unfortunately iFixit doesn't have a guide to show you how to do that, but I did locate a YouTube video that seems to be well done and complete.
[link|https://www.youtube.com/watch?v=hM0V5h6E6tA|Samsung Galaxy Tab A7 10.4 Display Replacement - YouTube]
As for a replacement screen, it appears to be readily available on such sites as Amazon, eBay and AliExpress, among others. Here's one that came up on my cursory search; be sure and check any ones you're considering against your actual model number to verify it's correct for your tablet.
[link|https://www.aliexpress.us/item/3256804495373841.html|10.4" LCD Display For Samsung Galaxy Tab A7 10.4 2020 SM-T500 T505 T500 LCD Touch Screen Digitizer Sensors Assembly - AliExpress 7]
As you work, take lots of pictures so you can use them to create your own iFixit guide to that repair to help out others who come along after you with the same problem. It's easy, fun and will earn the gratitude of the repair community.
[link|https://www.ifixit.com/Guide/new|Create a new Guide - iFixit]
Good luck; let us know how it all turns out!