How to periodically deduct user points for flagged nodes?
Part 1 - Deducting user points

Repeat the daily deduction of user points

Use the rules scheduler as explained in the video about "Repeating scheduled events". The "clue" here is:


as the last action of your rule, you reschedule the same rule to be executed again after +1 day(s).
the very first time you need to trigger the execution of this rule manually (from the Rules UI). Or you can use the Rules Event "when node is flagged".


Video tutorials

If you're not familiar (enough/yet) with Rules, checkout the 32 (!!!) great, and free, video tutorials Learn the Rules framework.

Part 2 - Stop deducting if insufficient user points

The 2nd part of your question is about "... when user doesn't have enough points anymore, then node must be unflagged ...". The challenge with that is that there is no Rules Condition like "If user has less then X user points".

However, to also make that work, you can use a Rules Action "Load user points of a user", as an alternative (work around?) for something like a missing Rules Condition to "check the current user points for a user". Have a look at my answer to "How to create rule to change user role based on points (using User Points module)?", which includes an sample rule that uses this Rules Action.

So all you have to do is to further enhance your rule as in Part 1, by using the Conditional Rules module so that your Rules Action will look something like so:


  Load user points balance
  
  If user points balance > 40
  
  then reschedule the same rule to execute in 1 day.