The Wikipedia article on Artemis 1 says that an ICPS disposal burn was performed after spacecraft separation. This was intended to send the ICPS into heliocentric orbit after passing the Moon. Why didn't the flight profile call for the ICPS to impact the moon instead, like the S-IVBs on the last 5 Apollo missions?
The upper stage for Apollo 8 through Apollo 12 were sent into heliocentric orbit. On the last five flights, Apollo 13 through Apollo 17, the upper stages were instead intentionally crashed into the lunar surface. The difference between these two sets of upper stage mission profiles is that Apollo 11 and Apollo 12 left behind sets of seismometers that sensed such impacts. The Apollo 11 set failed within a few weeks. The working set left by Apollo 12 was later augmented by sets of seismometers left on the lunar surface by Apollo 14, 15, and 16.
The upper stages from the later missions were intentionally crashed onto the lunar surface so as to give insight regarding the nature of the Moon's interior, thanks to that network of seismometers left behind on the lunar surface. The seismometers captured data such as this from the impacts (Apollo 13 impact pictured below):
Source: Apollo 13's Booster Impact at nasa.gov
The petrochemical industry uses similar techniques to this day to find good places to drill for oil and gas. They install a network of seismometers and then thump the ground, hard. The returns from the seismometer network give a picture of what's underground.
The last functioning seismometer left on the lunar surface ceased working 45 years ago, in 1977. A crash by the ICPS now would accomplish little from a scientific perspective and might violate updated planetary protection protocols.
Whether the upper stage went into heliocentric orbit or crashed on the lunar surface, that was not the trajectory NASA wanted the Apollo vehicle to follow. This is called offset targeting. The Apollo vehicle had to perform a correction burn after separation to place it on the desired trajectory. Missions to Mars similarly use offset targeting, but with stricter rules on planetary protection. The presumably non-sterile upper stage is targeted to miss Mars, and continue missing Mars for a long time. The Mars-bound vehicle has to perform a post-sep correction to place it on the right trajectory.