Liberalism is an ideology that believes that it is very important to protect the rights of the individual. One of the most important aspects of liberal democracy is its dedication to the idea of free speech.
The laws that you mention here both infringe very seriously on people's freedom of speech (and the related right to freedom of association). These laws say that political parties that make certain arguments (in favor of socialism or communism or just, in the case of the Enabling Act, disagreeing with Nazism) are illegal. Banning political parties because you disagree with their ideas is very much opposed to the ideas of liberalism.