Hi Sunny,
Yes. You need to install SAP license for secondary sever as well.
You may failover your SAP system to secondary node and apply relevant license.
Ensure license is applied for both the nodes to ensure users can login even after failover.
Hope this helps.
Regards,
Deepak Kori