They knew Bahrain was a problem and therefore moved operations to Diego Garcia, which is further away. Djibouti can be hit from Yemen, where the Iranian allied Houthis are after all. However then Diego Garcia was hit as well. They did not destroy too much, but the Navy moved logistics further away. However that would have pulled Lincoln out of combat range. Otherwise it would have to stay in place in range of Iranian missiles. Iran hitting an aircraft carrier would have been a massive issue.
So apparently they believed it was smarter to keep it in the fight, since Trump was going to end the war in a few days anyway since a few months now.
This is why the US used to avoid going to war with Iran. They knew it would turn into a shit show.