Multiple Matrix blocks on one page
If you look at how Craft handles routing you will see this:


  If the URI matches an entry’s or category’s URI, the section’s/category group’s template will get loaded, and the matched element will be made available to the template via a pre-populated entry or category variable.


So Craft is assigning that entry variable that you are referencing on line 1 of your code. Then on line 3, you do {% set entry = block.sideLink.first() %} which overwrites that initial entry variable with this new value, which is why the second matrix disappears.

What you probably want to do is this:

{% for block in entry.sideMenu %}
  {% if block.type == "sideMenuItem" %}
    {% set sideLinkEntry = block.sideLink.first() %}
    {% if sideLinkEntry %}
       &lt;a href="{{ sideLinkEntry.url }}"&gt;{{ block.sideTitle }}&lt;/a&gt;
    {% endif %}
  {% endif %}
{% endfor %}


And your original entry will be unmodified.