The Valmiki Ramayana also several times refers to Lord Kartikeya as Guha. Like in Yuddha Kanda, strike of Kumbhakarna by Hanuman was compared with strike of Lord Kartikeya (Guha) on Krauncha Mountain.
स शूलमाविध्य तडित्प्रकाशं |
गिरिर्यथा प्रज्वलिताग्रशृङ्गम् |
बाह्वन्तरे मारुति माजघान |
गुहोऽचलं क्रौञ्चमिवोग्रशक्त्या || 6.67.19
Holding firmly the spike, which was bright as lightning and looking like a blazing mountain-peak, Kumbhakarna struck Hanuma on his chest, as Guha (the son of Shiva) struck Krauncha mountain with his powerful Shakti.
Kartikeya is called 'Guha' because he is the one who resides in Guha (heart) of creatures, who is Guhya (secret), who knows Guhya vidya (secret knowledge). Shiva Purana Kailash Samhita chapter 11 summarises all these meanings of Guha in just a single verse:
नमो गुहाय भूतानां गुहासु निहिताय च ।।
गुह्याय गुह्यरूपाय गुह्यागमविदे नमः ।।२४।।
Salutations to Guha who resides in Guha (heart) of all living beings. Who is secret (Guhyaya), who has secret form (Guhyarupaye) and who knows the secret Agamas (Guhyagamavide).
Thus Kartikeya is called Guha because - "भूतानां गुहासु निहिताय च ।। bhUtAnAM guhAsu nihitAya cha ||", he resides in the heart of all beings!