Well that’s because you’re suppose to map to the Toggle Arm Auto-Spoiler not Toggle Spoilers.
Toggle Spoiler is for Retracting and Deploying spoilers as you said, you press it, it deploys, you press it again, it retracts. But this is for manual deployment, not for automatic deployment like when landing.
But since you’re doing auto-spoiler, you can’t use the same command. You need a different one, which is the Toggle Arm Autospoiler. So you press it, it arms the auto-spoiler. You press it again, it disarms the auto-spoiler.
Before you land, you press the Toggle Arm Auto-spoiler button to arm it. Once you land and the auto-spoilers deploy, when you’re slow enough and vacate the runway, you press the Toggle Arm Auto-spoiler again to disarm the auto-spoiler and the spoilers will automatically retract after that.
Additionally if the toggle spoilers doesn’t deploy the spoilers, there’s definitely something else conflicting, either something or other buttons or axis bound to the spoiler controls, it could also be coming from another hardware, sometimes it can also be bound to a non-existent hardware. So if you press toggle spoilers and you hear a click but nothing happen, chances are the sim is also receiving a phantom input about the spoilers position and that overrides the toggle command that you press.
I had that issue before with my TCA Quadrant spoilers addon, I had the lever set to Spoiler axis, but I also need the autospoiler bound to another button, When I press the Arm autospoiler button, it arms it correctly, but the spoilers never deploy on touchdown. I found out it was because the spoilers axis is overriding the auto-spoiler. Since the lever is positioned at the retract position, the spoilers are always in the retracted position no matter what. So I had to remove the spoilers axis from the lever, and the autospoilers deploy again.
Then I reworked my spoilers lever axis to have digital input instead, Retract Spoilers at the top position, Set Arm Auto-Spoiler on the second position, then Deploy Spoilers at the full position. That way I can still use the spoiler lever manually but at the same time, without axis bound, there’s nothing to conflict my spoiler position and always deploys on landing everytime and I can retract and deploy manually anytime too.
It’s for this reason that I reworked my entire hardware profiles. With a TCA Sidestick and Throttle quadrant, I don’t really need any other controls, so I reset my Keyboard to have a blank profile, with only ESC bound to Toggle Pause and Pause Off. Nothing else bound on the keyboard means the keyboard will not feed conflicting bindings to the sim. Then I carefully reset my sidestick from a blank profile and making sure all my keybinds are unique. The TCA Quadrant though, is done slightly differently as I reset it to use the default Profile, then duplicate that profile as a base then make the adjustments there, like removing the spoilers axis, replacing them with digital inputs, then combining the engine master and engine mode selector switch to double up as Beacon lights, and also some buttons to trigger the upper view cam. Then I make sure there’s no more than 1 button is bound to the same command.