There are currently no direct trains because Spanish railways used COVID as an excuse to get rid of all remaining night trains in/from Spain. Portuguese railways still want to operate a night train to Spain (more specifically to Irún/Hendaye) and they're working on that but that will now happen this year.
There will probably a future high-speed day train between Madrid and Lisbon but again not this year. For the current train options, check this page.
Note: for Spanish timetables, use the RENFE website. RENFE (Spanish railways) only share some of their timetables with the rest of the world and therefore all planners, including the rail planner app, are very incomplete for Spain.
1.depending on the rest of your planned route, it may simply be not so good an idea to use IR/Eurl for that. A widereaching and generally cheaper BUSnetwork also serves all touristy places.
2.the why hardly matters, the actual situation is what it is. There is a 1/day connection-with 1 easy and 1 easy to miss connection from L to M, via Badajoz, and 1st (CP-IC) and last (RENFE-IC/MD) needs to be reserved, in between is a short local dieselset (via Entroncamento-Elvas-Badajoz).
Also note that MAD esp. in those summermonthes can be unbearably hot desert-like
As always: best to use the planners of the national railways: cp.pt and renfe.com. They will not work yet for summer, use a same weekday for rough planning what is available. AND search and read the country-info in the general site!