It is for user experience reasons, as you surmise, but the security is not compromised as much as you may think.
Most implementations use 6 digit HOTP/TOTP schemes and design their implementation of the scheme to give them a security level they are comfortable with.
For HOTP, the key parameter that allows 6 digits to be secure enough is the throttling behaviorthrottling behavior. When combined with a sensible look-ahead window size $s$, the probability of a brute force attack succeeding is low enough as the account or client will be unable to attempt a large number of guesses.
The throttling argument for TOTP is the same, as it is based on HOTP. The security calculation differs but the same principles apply.
The converse of course is that inappropriate selection of look-ahead/behind or throttling behavior does indeed open up a 6 digit decimal OTP to brute force attacks with high probability of success.