Having done modding on civs AI building system, it's definitely a little more complex than 'build whatever I can', but the general gist of your video is correct in that it ignored about 95% of relevant info.
What it does is basically giving a score to every building it can build, and to units requested by 'contracts' (how that works is kind of irrelevant here).
It determines these scores based mostly on the resource yields + some extra factors it expects to get out of it. Civs can have differing desires for culture,food, etc. And it just multiplies that desire by the amount of gains.
Additionally, it can gain some bonusses/reductions to the score based on what kind of object it is, wonders get a different bonus from buildings/districts.
then it just selects the highest score, and builds that.
Unfortunately, the system is very underdeveloped. It for example generally doesn't care at all about 'complicated' effects, basically anything that isn't just a flat culture bonus or whatever. Chicen itza's rainforest effect is such a complicated effect, so it doesn't care at all. Because it doesn't understand these effects (present on most wonders) at all, and because it'd be weird if AIs never built any wonders, wonders are by default desirable enough that they'll sometimes be build, regardless of what its effect does. Some civs are also more likely to build certain wonders, again regardless of what the actual effects are.
And yes, the scoring mechanisms miss a lot of other important factors too, like being at war / being under siege, being locked out of producing stuff, the worth of the tile a wonder takes up, and so on.
As for why that is the case. While I would've done things differently, I can at least somewhat sympathize with them on this point. They (likely not the AI dev) chose to make the game very moddable, not just by modders but also by themselves (90% of the new expansion is a mod). They seem to have not hardcoded anything about buildings, policies, techs, and so on inside of their codebase. So most of the input the AI takes has to come out of the moddable xml files they made. And while taking the plain resource yields off of buildings and basing decisions based on that is pretty straightforward, and while dealing with just chicen itza would have been relatively straightforward, writing a generalized AI that is able to infer what a wonder does and then makes reasonable decisions on it is not so easy.