Reason for red wire in switch box?
I  brightened the picture in Photoshop and confirmed there is only one /3 cable coming into this box.   That makes it 1 of 3 possibilities.

The far &quot;spur/loop&quot; end of a 3-way switch complex.
A modern &quot;switch loop&quot; which brings Always-hot, Switched-hot and Neutral (for smart switches).
The ceiling box is fan-rated with an obsolete &quot;switch loop&quot;, but with an extra wire for separate control of light and fan.

In the last 2 cases, the cables in the wall are the same; you get to decide which of the two it will be, by how you wire it in the ceiling.
This much for sure, we have to see the wiring up in the lamp box to know any more.  There is definitely at least one more cable up there.  We need to see how they are interconnected, and whether the box has a &quot;Fan Rated&quot; marking.
P.S. Make sure your smart switch has a UL, CSA or ETL listing.  We see a LOT of cheap junk flooding the flea-markety mail order channels like eBay, Banggood, DealExtreme and unfortunately Amazon has opened their site to the eBay gang.  The junk even ships with Prime because they opened their warehouses too.
Edit:
Given that there is apparently no existing ceiling box, it is most likely a switched receptacle.  If there is no ceiling light the only other way to meet Code is a switched receptacle.  That greatly increases the likelihood of the second possibility.
Often, rooms are wired with red-white-black circling the room.  Black is always-hot, red is switched-hot and white is neutral. Most receptacles are punched down to black and white (always hot).  The switched receptacle is punched down to red and white.  It was uncommon to extend the /3 all the way to the switch until 2011, but hey, OK :)
Often, such an installation will use a &quot;split&quot; receptacle (tab broken off on the hot side) to allow each socket's hot to be fed from a different wire.  One socket gets red (switched) and the other gets black (unswitched).
This would also jibe with the observation that red and black are both hot.  Very often, a dumb novice comes along who is changing receptacles for aesthetic reasons. They don't even know tabs are a thing. So they don't look for broken tabs, and they don't break the tab off on the new recep.  This has the effect of shorting black and red, making the switch ineffective.  The switch stops working, they shrug their shoulders and resign themselves to switching lights off at the floor lamp.
So my working theory is you inherited the above situation.  You'll need to open up the receptacle boxes in the room and see what  you can see.  It may simply be a matter of snapping off the right tab.