It it is not clear to me which the rules are for which row in #loa to pick for a certain month. Here is a query, but it does not match your expected output exactly.
SELECT a.eid, m.Month_startdate, l.loa_startdate, l.loa_enddate
FROM #Monthdata m
CROSS JOIN (SELECT DISTINCT eid FROM #loa) AS a
CROSS APPLY (SELECT TOP (1) loa_startdate, l.loa_enddate
FROM #loa l
WHERE l.eid = a.eid
ORDER BY CASE WHEN m.Month_startdate <= l.loa_startdate THEN l.loa_startdate ELSE '99991231' END ASC,
CASE WHEN m.Month_startdate > l.loa_startdate THEN l.loa_startdate END DESC) AS l