Enchantments on spears that are used in the offhand do not take effect. This is not the case for other right click functionality weapons, such as bows/crossbows/tridents, whose enchantments correctly take effect in the offhand. In the attached video, the spear used to do a charge attack in the offhand does not apply its Fire Aspect or Sharpness enchantments, while it does when used to do a charge attack in the mainhand.
It seems to use the enchantments of whatever item is in the mainhand. For example, if you hold a sword with fire aspect in the mainhand, and then do a charge attack with an unenchanted spear in the offhand, the fire aspect applies to the spear charge attack, despite that spear not having fire aspect.
Thank you for helping us improve Minecraft! We saved your files: