आपको दो बार जुड़ना होगा। तालिका को अलग-अलग उपनाम दें ताकि आप उन्हें अलग कर सकें।
SELECT h1.name as host_name, h2.name AS template_name
FROM hosts_template AS t
JOIN hosts AS h1 ON t.hostid = h1.hostid
JOIN hosts AS h2 ON t.hosttemplateid = h2.hostid