I see it as both if for no other reason, when he makes any bigoted comment, he gets rewarded (cheers and applause) which only reinforces that random brain cell firing that makes him say that in the first place. Even if it is random babbling, he’s quite aware of what he’s doing: Trump Checks Crowd Over ‘Crazy’ Ovation: You ‘Didn’t Know’ About This 5 Years Ago
Note: That one was about trans people, but I promise it’s not the only bigoted rally flag he’s waving and knows it.