You only altering the user. Not the profile.
scott@9i > declare
2 cursor c1 is select username from dba_users where username in ('OLD','NEW');
3 begin
4 for mag in c1 loop
5 execute immediate ('alter user '||mag.username||' password expire');
6 end loop;
7 end;
8 /
PL/SQL procedure successfully completed.
scott@9i > connect old/old
ERROR:
ORA-28001: the password has expired
Changing password for old
New password:
Retype new password:
ERROR:
ORA-00988: missing or invalid password(s)
Password unchanged
Warning: You are no longer connected to ORACLE.